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

validation of required input parameters #69

Open
gregb502 opened this issue Sep 17, 2021 · 0 comments
Open

validation of required input parameters #69

gregb502 opened this issue Sep 17, 2021 · 0 comments

Comments

@gregb502
Copy link

In petstore api, the photoUrls property of the Pet definition is a required property.

When I tried to register a new pet using curl, if I set the photoUrls to null, the pet is registered in the store.

curl -X 'POST'
'https://petstore.swagger.io/v2/pet'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"id": 123456789987,
"category": {
"id": 0,
"name": "string"
},
"name": "doggie",
"photoUrls": null,
"tags": [
{
"id": 0,
"name": "TheTag"
}
],
"status": "available"
}'

When I tried to look at this pet using the path /pet

curl -X 'GET'
'https://petstore.swagger.io/v2/pet/123456789987'
-H 'accept: application/json'

{"id":123456789987,"category":{"id":0,"name":"string"},"name":"doggie","tags":[{"id":0,"name":"TheTag"}],"status":"available"}

The answer does not contain the required photoUrls property (and some of the sdk generated with the swagger generator that check that this property is set (python) produce an error.)

Thanks

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