Manfred / Reynard

Minimal OpenAPI client for Ruby.
MIT License
12 stars 2 forks source link

Extend support for schemas with no title property #51

Closed alexmalus closed 5 months ago

alexmalus commented 7 months ago

Our codebase using Reynard has a specification file for API's that we consume; we've encountered several edge cases leading to exceptions, those that can be seen through https://github.com/Manfred/Reynard/commit/4e9bcd0ff13b02d79d3c70d5e679d91d0d744eb6, which disrupts the day-to-day operations of the application.

Ideally, Reynard does not throw exceptions while instantiating model instances when the response schema does not have a title property set, but continues to work as expected.

This PR extends the private method Reynard::Schema#node_property_name; it also adds the base node name in the mix to result in a dynamically generated unique model class name (as opposed to a fixed Schema class name which would create clashes).

alexmalus commented 7 months ago

@Manfred is this something you can find time to review please?

Manfred commented 7 months ago

This specific implementation breaks other use-cases, but I will write issues to describe the problems and think of a way to fix them.

alexmalus commented 5 months ago

Closing since the intention is to have Reynard working elsewhere as well.