Redocly / museum-openapi-example

An example OpenAPI description for an imaginary Museum API.
https://redocly.com/docs/resources/learning-openapi/
MIT License
40 stars 36 forks source link

Refactor: Uncouple from HTTP and use data models #32

Closed lornajane closed 1 month ago

lornajane commented 5 months ago

What/Why/How?

When we created the Museum API, we stopped iterating at the HTTP data transfer level. This PR doesn't change much of the API description (removed phone numbers from ticket records) but takes a more RESTful approach of modelling entities.

Still needs work: since the ID fields are readonly, I ran into https://github.com/Redocly/redocly-cli/issues/1416 which marks the examples as invalid.

Check yourself

Security

lornajane commented 1 month ago

@rudi23 Finally got back to this! I don't think the 404 responses make sense for the collection endpoints because they exist, I've defined them .... does that make sense? I picked up most of your other comments and removed the readOnly fields since our linting doesn't handle these yet. I've left optional fields in place an we can iterate.

rudi23 commented 1 month ago

@rudi23 Finally got back to this! I don't think the 404 responses make sense for the collection endpoints because they exist, I've defined them .... does that make sense? I picked up most of your other comments and removed the readOnly fields since our linting doesn't handle these yet. I've left optional fields in place an we can iterate.

👍 Yes, I totally agree, not sure why I recommended 404 for the collection endpoint 😅