Skip to content

Visit post #234

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Visit post #234

wants to merge 3 commits into from

Conversation

peterfk
Copy link
Contributor

@peterfk peterfk commented Jun 3, 2025

This pr is for issue #231. It includes petId for the post payload and makes it required since it's a required field in the table. It also changes the put method to preserve the existing interface since petId is not editable. Let me know if any changes are required.

@vfedoriv
Copy link
Collaborator

vfedoriv commented Jun 3, 2025

It includes petId for the post payload

@peterfk Not sure I got it - as I see you made changes for PUT endpoint, it's not a POST

@@ -2086,9 +2086,9 @@ components:
format: int32
minimum: 0
example: 1
readOnly: true
Copy link
Member

Choose a reason for hiding this comment

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

question: could you explain why you changed the readonly flag of the petId property belonging to the Visit type that you didn't use again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the read only flag was the root issue. It means the the field is only displayed in the response not the request object. But it is needed for the request object on the post (insert) operation. Does that answer it for you?

@arey arey added the bug label Jun 3, 2025
@peterfk
Copy link
Contributor Author

peterfk commented Jun 3, 2025

I then changed the put op because petId as a required field would have showed up in that one too but we don't want it there since petId is not editable

@peterfk
Copy link
Contributor Author

peterfk commented Jun 3, 2025

Interestingly this whole thing is really a documentation error. Even without these changes you can manually add petId to the post and it will work but no one will know that unless you really look at the code.

@peterfk
Copy link
Contributor Author

peterfk commented Jun 7, 2025

I should clarify that I'm talking about the swagger documentation

Swagger UI is available at: http://localhost:9966/petclinic/swagger-ui.html.

just in case that wasn't clear

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

Successfully merging this pull request may close these issues.

3 participants