Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Open API generation behaviour based on "readOnly" tag #14

Open
onthebreeze opened this issue May 27, 2021 · 0 comments
Open

Add Open API generation behaviour based on "readOnly" tag #14

onthebreeze opened this issue May 27, 2021 · 0 comments

Comments

@onthebreeze
Copy link
Contributor

In the interests of keeping the model simple and understandable, The UML profile for OpenAPI embeds some opinionated rules about the request/response structure for GET/POST/PATCH/PUT/DELETE. for example

  • GET request is an ID or query string and response is the whole data structure
  • POST request is the whole data structure and response is the ID
  • PATCH request is any subset of the data structure and response is the whole (updated) data structure
  • PUT request is the whole data structure and response is the whole (updated) data structure.

Mostly they work ok but there are cases when you want a property of the structure to be in the server response but not settable by the client. For example a customs clearance status is something the server defines and communicates to the client (in a GET response) but is certainly not something the client can set (so should not be available in the POST/PATCH/PUT request.

Therefore we should allow the UML designer to use the native UML "readOnly" tag on any property. And the result in the generated spec should be that the property appears in GET and PATCH/PUT response but not in POST/PUT/PATCH request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant