You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
I have begun experimenting with swagger and swagger-tools has been an obvious choice but i am a bit confused about some valid JSON schema elements not being honored by the swagger validator.
To take the weather example , I wanted to add a 'pattern' to the 'location' parameter stating it must follow a specific pattern, so i added pattern to the location parameter
If you're using the latest, the only thing I can think of is your pattern is wrong. JSON Schema does validate that the pattern value is a ECMA 262 regular expression pattern. It would be nice to see the pattern.
I just tried the latest release, 0.6.5, and this works fine. I took the example in the repository, added the pattern property to one of the parameters and it worked fine. Can you verify that this is no longer an issue when you upgrade your version of swagger-tools?
I have begun experimenting with swagger and swagger-tools has been an obvious choice but i am a bit confused about some valid JSON schema elements not being honored by the swagger validator.
To take the weather example , I wanted to add a 'pattern' to the 'location' parameter stating it must follow a specific pattern, so i added pattern to the location parameter
"parameters": [
{
"name": "location",
"in": "query",
"description": "The MSN Weather location search string.",
"required": true,
"type": "string",
"pattern":"validPattern"
}
]
Swagger spec says this should be possible, but the swagger tools validator says
/paths//weather/get/parameters/0/pattern: Additional properties not allowed: pattern
Can someone please explain whats going on here because i have seen this happen for other properties as well.
The text was updated successfully, but these errors were encountered: