p2-inc / phasetwo-docs

docusaurus repo for phasetwo.io public website and documentation
1 stars 11 forks source link

Fix the organization creation docs #90

Closed hisorange closed 1 year ago

hisorange commented 1 year ago

Hey there,

A small fix for the OpenAPI definition, when the organization is created the id property is discarded from the input and a new one is generated see here

P.s.: Didn't wanted to change the OrganizationRepresentation as it's used in multiple places, but I hope the naming will be okay, let me know if you wanna have some different pattern for it.

Anyways, have a wonderful day!

xgp commented 1 year ago

I appreciate this, but I'm not going to do a separate type for something that is a documentation problem. It causes the generated classes in the libraries to proliferate and become unwieldy. Is it possible to just put a comment on the id field that indicates it is not required / ignored when creating a new resource?

hisorange commented 1 year ago

I need to look into that, because as far as I remember the "required" tag has to be defined on the model. And if I mark the id not required aka optimal then it will be optimal everywhere even in responses.

Usually this is where DTOs came into the picture, and sadly the representation does not match the actual input.

I will check if there is a hack around it.

xgp commented 1 year ago

Thanks for looking into a different solution @hisorange . I'll consider the different request object if it's the only way around it.