highsidelabs / saloon-sdk-generator

Generate Saloon SDKs from Postman Collections and OpenAPI Specifications.
MIT License
2 stars 5 forks source link

Handle inline schemas with the same property name #9

Closed jlevers closed 3 months ago

jlevers commented 3 months ago

Given an OpenAPI model file with multiple inline schemas with the same property name, each time the code for an inline schema with that name is generated, it overwrites the code for the last inline schema with that same name. For instance, the _links and _embedded schemas in the Messaging and Solicitations segments of the Selling Partner API run into this issue.

Inline schemas are generated here:

https://github.com/highsidelabs/saloon-sdk-generator/blob/b7ab312054d0404cdac1391f06d6ec77e9b04764/src/Normalizers/OpenApiNormalizer.php#L235-L242

We need to do some sort of check to ensure that we're generating a new schema with a new name when there are inline schemas with the same name but different definitions.

jlevers commented 3 months ago

Fixed in faad7aa.