Hello All,
I have recently started working on JSON Schema v4 and RESTfull API implementation.
We (team) as decided to use Swagger supported API description file as a center piece for the implementation.
I'm wondering to understand - is below URL a valid one?
http://localhost/v1/List?filter={"params":[{"operator":"ALL","clauses":[{"cmp":"=","filter_key":"status","filter_value":"0"}]}],"duration":{"type":"past","past":"month","range_start":"","range_end":""}}&secure=no
- I have gone through the RFC3986 but still not able to conclude. It seems valid because as per rfc -
------------
The following are two example URIs and their component parts:
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
| _____________________|__
/ \ / \
urn:example:animal:ferret:nose
....
query = *( pchar / "/" / "?" )
------------
- I also used this URL in browser and it is supporting that (means i'm getting it at the server side without any issue).
So, if above URL is valid then why i'm not allowed to define above GET method in swagger API document like below -
...
"in":"query",
"type":"object",
...
As per swagger specification v2.0 they are mentioning -
--------------
If in
is "body"
:
Field Name | Type | Description |
---|
schema | Schema Object | Required. The schema defining the type used for the body parameter. |
If in
is any value other than "body"
:
Field Name | Type | Description |
---|
type | string | Required. The type of the parameter. Since the parameter is not located at the request body, it is limited to simple types (that is, not an object). The value MUST be one of "string" , "number" , "integer" , "boolean" , "array" or "file" . Iftype is "file" , the consumes MUST be either "multipart/form-data" or " application/x-www-form-urlencoded" and the parameter MUST be in "formData" . |
--------------
Please help to understand, is this a swagger v2.0 spec issue or JSON schema v4 or URL formation?
I want to create a JSON schema for the above URL "filter" JSON and want to use in swagger API description file.
Thank you.