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.
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?
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.
What's the alternative to https://packagemain.tech/i/156923596/generate-oas-from-code?
The alternative (and actually what I prefer) is to generate the boilerplate from OAS, so schema goes first
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.
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?
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.
I really like the newsletters! Keep it up! ❤️
Thanks, will keep posting!