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

get property when validate path or header - justinrainbow-json-schema #627

Closed
tomzdon opened this issue Apr 8, 2020 · 2 comments
Closed

Comments

@tomzdon
Copy link

tomzdon commented Apr 8, 2020

I would like to get a property when validating a path or header (GET method - REST API). My application was written in laravel 6 version.

My part json-schematic about parameters
"Parameters": [
{
"In": "header",
"Name": "customer ID",
"Required": true,
"Type": "string"
},
{
"In": "path",
"Name": "product_id",
"Required": true,
"Type": "string",
"MaxLength": 24
}
]
When I send GET, where product_identifier has 25 words, I get errors, but without properties

0 => array: 6 [
"Property" => ""
"Pointer" => ""
"Message" => "Must be up to 24 characters"
"Constraint" => "maxLength"
"Context" => 1
"MaxLength" => 24
]

How can I get property?

@erayd
Copy link
Contributor

erayd commented Apr 8, 2020

Can you please provide an example JSON schema and document to reproduce using this library only. I'd like to see what the library is being expected to take as input.

@DannyvdSluijs
Copy link
Collaborator

@tomzdon it seems like you mixed (parts of) OpenApiSpec/Swagger with json-schema. This library is used for validating a JSON document it doesnt help out with request parameters such as path or headers.
In an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Is it safe to assume this is a rather old issue, which sadly was left unanswered, and can be closed? Feel free to close it yourself with some comments if helpful.

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

3 participants