webflow / openapi-spec

OpenAPI specification for the Webflow REST API
http://developers.webflow.com
MIT License
11 stars 2 forks source link

Use references to common schema instead of inline schema #2

Open looloosha opened 3 months ago

looloosha commented 3 months ago

I'm trying to use NSwag, an Open API to C# language client generator but am running into issues because of how the Open API spec is defined. The goal is to quickly get a C# SDK generated so I can interact with the CMS in my C# azure applications.

Because the spec doesn't use references for common schema across endpoints, my code generator is generating many duplicate objects for request and response objects and child objects.

For example, FieldData, FieldData1, FieldData2, ... etc. is being generated by my code generator because references aren't being used in the spec. This makes code generations very basically impossible/unusable. I would recommend that references be used throughout the spec instead of duplicate inline schema being defined.

Here is the documentation on references: https://swagger.io/docs/specification/using-ref/

Let me know if you'd like the generated code so you can see where duplication is occurring. It's happening all over the place.