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

Refactor: Uncouple from HTTP and use data models #32

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

lornajane
Copy link
Contributor

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 Redocly/redocly-cli#1416 which marks the examples as invalid.

Check yourself

  • Code is linted
  • Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@lornajane lornajane marked this pull request as draft June 24, 2024 14:20
Copy link

@rudi23 rudi23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. can we get 404 for GET /museum-hours? or it will be 200 with empty items: []
  2. can we get 404 for POST /special-events?
  3. there is 401 for DELETE /special-events/{eventId}? shouldn't we define security if we wan't to achieve it?
  4. can we get 404 for POST /tickets?

openapi.yaml Show resolved Hide resolved
openapi.yaml Show resolved Hide resolved
openapi.yaml Outdated Show resolved Hide resolved
openapi.yaml Show resolved Hide resolved
@lornajane lornajane force-pushed the description-refactor branch from 5ea9b56 to b859726 Compare October 7, 2024 14:30
@lornajane
Copy link
Contributor Author

@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.

@lornajane lornajane requested review from rudi23 and a team October 7, 2024 14:40
@lornajane lornajane marked this pull request as ready for review October 7, 2024 14:40
@rudi23
Copy link

rudi23 commented Oct 8, 2024

@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 😅

@lornajane lornajane merged commit 3bdfc57 into main Oct 8, 2024
2 checks passed
@lornajane lornajane deleted the description-refactor branch October 8, 2024 13:03
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

Successfully merging this pull request may close these issues.

3 participants