Fixed the endpoint import service so it sends the correct \_id values in POST requests.
Refactored OAS adapter and SchemaBuilder so parent-child relationships between component param names are preserved, and parameters that share the same name are not overwritten as a result of flattening nested schemas. The functions __extract_param_properties and __dereference (from OAS adapter), and build (from SchemaBuilder) should be more simple and easier to read.
Expected Benefits
Should fix issues with parent-child relationships and type values (#223)
Not preserving proper parent-child relationships for some nested schemas due to the partial flattening of the literal_body_params dictionary when adding param name literals. This caused the SchemaBuilder to generate incorrect \_id (parent ids) values, due to broken nested schema structures, as well as incorrect query strings.
Key collisions in the literal_body_params dictionary due to property names being used as keys. This caused some parameters to be overwritten if they shared a name with another parameter that happened to be added to the top level of the dictionary as a result of flattening.
Not being able to handle query parameters that used references in their schema definition
Noticed that for the GET /v1/developer-products/list endpoint, DeveloperproductsElement should be cased as DeveloperProductsElement.
Otherwise, everything else looks good!
Changes Made
Fixed the endpoint import service so it sends the correct \_id values in POST requests.
Refactored OAS adapter and SchemaBuilder so parent-child relationships between component param names are preserved, and parameters that share the same name are not overwritten as a result of flattening nested schemas. The functions
__extract_param_properties
and__dereference
(from OAS adapter), andbuild
(from SchemaBuilder) should be more simple and easier to read.Expected Benefits
Should fix issues with parent-child relationships and type values (#223)
Example: (petstore-expanded.yaml)
Also fixes some bugs that the OAS adapter had:
literal_body_params
dictionary when adding param name literals. This caused the SchemaBuilder to generate incorrect \literal_body_params
dictionary due to property names being used as keys. This caused some parameters to be overwritten if they shared a name with another parameter that happened to be added to the top level of the dictionary as a result of flattening.Testing
Updated SchemaBuilder and OAS adapter tests.