forked from loafle/openapi-generator-original
Better inline model resolver to handle inline schema in array item (#12104)
* better support of inline schema in array item * update tests * update samples * regenerate samples * fix allof naming, remove files * add files * update samples * update readme * fix tests * update samples * update samples * add new files * update test spec * add back tests * remove unused files * comment out python test * update js test using own spec * remove files * remove unused files * remove files * remove unused files * better handling of allOf with a single type * comment out go test * remove test_all_of_with_single_ref_single_ref_type.py * fix inline resolver, uncomment go test
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
Model/200Response.sql
|
||||
Model/AdditionalPropertiesClass.sql
|
||||
Model/AllOfWithSingleRef.sql
|
||||
Model/Animal.sql
|
||||
Model/ApiResponse.sql
|
||||
Model/ArrayOfArrayOfNumberOnly.sql
|
||||
@@ -41,9 +42,9 @@ Model/OuterObjectWithEnumProperty.sql
|
||||
Model/Pet.sql
|
||||
Model/ReadOnlyFirst.sql
|
||||
Model/Return.sql
|
||||
Model/SingleRefType.sql
|
||||
Model/SpecialModelName.sql
|
||||
Model/Tag.sql
|
||||
Model/User.sql
|
||||
Model/UserType.sql
|
||||
README.md
|
||||
mysql_schema.sql
|
||||
|
||||
26
samples/schema/petstore/mysql/Model/AllOfWithSingleRef.sql
Normal file
26
samples/schema/petstore/mysql/Model/AllOfWithSingleRef.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
--
|
||||
-- OpenAPI Petstore.
|
||||
-- Prepared SQL queries for 'AllOfWithSingleRef' definition.
|
||||
--
|
||||
|
||||
|
||||
--
|
||||
-- SELECT template for table `AllOfWithSingleRef`
|
||||
--
|
||||
SELECT `username`, `SingleRefType` FROM `AllOfWithSingleRef` WHERE 1;
|
||||
|
||||
--
|
||||
-- INSERT template for table `AllOfWithSingleRef`
|
||||
--
|
||||
INSERT INTO `AllOfWithSingleRef`(`username`, `SingleRefType`) VALUES (?, ?);
|
||||
|
||||
--
|
||||
-- UPDATE template for table `AllOfWithSingleRef`
|
||||
--
|
||||
UPDATE `AllOfWithSingleRef` SET `username` = ?, `SingleRefType` = ? WHERE 1;
|
||||
|
||||
--
|
||||
-- DELETE template for table `AllOfWithSingleRef`
|
||||
--
|
||||
DELETE FROM `AllOfWithSingleRef` WHERE 0;
|
||||
|
||||
26
samples/schema/petstore/mysql/Model/SingleRefType.sql
Normal file
26
samples/schema/petstore/mysql/Model/SingleRefType.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
--
|
||||
-- OpenAPI Petstore.
|
||||
-- Prepared SQL queries for 'SingleRefType' definition.
|
||||
--
|
||||
|
||||
|
||||
--
|
||||
-- SELECT template for table `SingleRefType`
|
||||
--
|
||||
SELECT FROM `SingleRefType` WHERE 1;
|
||||
|
||||
--
|
||||
-- INSERT template for table `SingleRefType`
|
||||
--
|
||||
INSERT INTO `SingleRefType`() VALUES ();
|
||||
|
||||
--
|
||||
-- UPDATE template for table `SingleRefType`
|
||||
--
|
||||
UPDATE `SingleRefType` SET WHERE 1;
|
||||
|
||||
--
|
||||
-- DELETE template for table `SingleRefType`
|
||||
--
|
||||
DELETE FROM `SingleRefType` WHERE 0;
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
--
|
||||
-- SELECT template for table `User`
|
||||
--
|
||||
SELECT `id`, `username`, `firstName`, `lastName`, `email`, `password`, `phone`, `userStatus`, `userType` FROM `User` WHERE 1;
|
||||
SELECT `id`, `username`, `firstName`, `lastName`, `email`, `password`, `phone`, `userStatus` FROM `User` WHERE 1;
|
||||
|
||||
--
|
||||
-- INSERT template for table `User`
|
||||
--
|
||||
INSERT INTO `User`(`id`, `username`, `firstName`, `lastName`, `email`, `password`, `phone`, `userStatus`, `userType`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
|
||||
INSERT INTO `User`(`id`, `username`, `firstName`, `lastName`, `email`, `password`, `phone`, `userStatus`) VALUES (?, ?, ?, ?, ?, ?, ?, ?);
|
||||
|
||||
--
|
||||
-- UPDATE template for table `User`
|
||||
--
|
||||
UPDATE `User` SET `id` = ?, `username` = ?, `firstName` = ?, `lastName` = ?, `email` = ?, `password` = ?, `phone` = ?, `userStatus` = ?, `userType` = ? WHERE 1;
|
||||
UPDATE `User` SET `id` = ?, `username` = ?, `firstName` = ?, `lastName` = ?, `email` = ?, `password` = ?, `phone` = ?, `userStatus` = ? WHERE 1;
|
||||
|
||||
--
|
||||
-- DELETE template for table `User`
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
--
|
||||
-- OpenAPI Petstore.
|
||||
-- Prepared SQL queries for 'UserType' definition.
|
||||
--
|
||||
|
||||
|
||||
--
|
||||
-- SELECT template for table `UserType`
|
||||
--
|
||||
SELECT FROM `UserType` WHERE 1;
|
||||
|
||||
--
|
||||
-- INSERT template for table `UserType`
|
||||
--
|
||||
INSERT INTO `UserType`() VALUES ();
|
||||
|
||||
--
|
||||
-- UPDATE template for table `UserType`
|
||||
--
|
||||
UPDATE `UserType` SET WHERE 1;
|
||||
|
||||
--
|
||||
-- DELETE template for table `UserType`
|
||||
--
|
||||
DELETE FROM `UserType` WHERE 0;
|
||||
|
||||
@@ -24,6 +24,15 @@ CREATE TABLE IF NOT EXISTS `AdditionalPropertiesClass` (
|
||||
`map_of_map_property` JSON DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `AllOfWithSingleRef` generated from model 'AllOfWithSingleRef'
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `AllOfWithSingleRef` (
|
||||
`username` TEXT DEFAULT NULL,
|
||||
`SingleRefType` TEXT DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `Animal` generated from model 'Animal'
|
||||
--
|
||||
@@ -421,8 +430,7 @@ CREATE TABLE IF NOT EXISTS `User` (
|
||||
`email` TEXT DEFAULT NULL,
|
||||
`password` TEXT DEFAULT NULL,
|
||||
`phone` TEXT DEFAULT NULL,
|
||||
`userStatus` INT DEFAULT NULL COMMENT 'User Status',
|
||||
`userType` TEXT DEFAULT NULL
|
||||
`userStatus` INT DEFAULT NULL COMMENT 'User Status'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user