7 Comments
User's avatar
Chris Topinka's avatar

What's the alternative to https://packagemain.tech/i/156923596/generate-oas-from-code?

Expand full comment
Alex Pliutau's avatar

The alternative (and actually what I prefer) is to generate the boilerplate from OAS, so schema goes first

Expand full comment
Chris Topinka's avatar

Of course. You are still keeping the schema near the code but reversing the flow? Any update to api requires schema change first and then generate code. I think this is similar to BDD approach. I can see value in using schema editing tools in sessions with product owners so they get ownership of the api. Failing tests can be generated at the same time.

Expand full comment
A220's avatar

The id in the device schema is required. But for my create route my client does not have this information (id is generated by server). Does this mean that I need to create a second schema like DeviceWithoutId for all my create routes?

Expand full comment
Alex Pliutau's avatar

Good point. I saw this issue as well. Sometimes a separate Payload type may be required, because the create operation requires only a subset of fields.

Expand full comment
Loknath Dhar's avatar

I really like the newsletters! Keep it up! ❤️

Expand full comment
Alex Pliutau's avatar

Thanks, will keep posting!

Expand full comment