Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Params should not be required by default #52

Open
sko-apigee opened this issue Feb 8, 2016 · 6 comments
Open

Params should not be required by default #52

sko-apigee opened this issue Feb 8, 2016 · 6 comments

Comments

@sko-apigee
Copy link

Unless explicitly stated, a param should not be required by default. In the markdown it states:

required | boolean | Determines whether this parameter is mandatory. If the parameter is in "path", this property is required and its value MUST be true. Otherwise, the property MAY be included and its default value is false.

@whitlockjc
Copy link
Member

Where is this not happening?

@sko-apigee
Copy link
Author

We have a yaml file that doesn't have the property specified, but a127 is requiring the parameter to be there, unless required is explicitly set to false.

@whitlockjc
Copy link
Member

What's the pertinent part of your Swagger file and what is the actual failure message? You might need to use DEBUG=swagger-tools* a127 project start for that last part.

@sko-apigee
Copy link
Author

Here is the error when the property 'required' is missing from the yaml:

{
"message": "Validation errors",
"errors": [
{
"code": "INVALID_REQUEST_PARAMETER",
"errors": [
{
"message": "Cannot read property 'readUInt8' of
undefined",
"path": [
"paths",
"",
"get",
"parameters",
"0"
]
}
],
"in": "query",
"message": "Invalid parameter (orderBy): Cannot read property
'readUInt8' of undefined",
"name": "orderBy",
"path": [
"paths",
"",
"get",
"parameters",
"0"
]
}
]
}

This is what's in the yaml:
get:
parameters:
- in: query
name: orderBy
type: string

On Mon, Feb 8, 2016 at 3:50 PM, Jeremy Whitlock [email protected]
wrote:

What's the pertinent part of your Swagger file and what is the actual
failure message? You might need to use DEBUG=swagger-tools* a127 project
start for that last part.


Reply to this email directly or view it on GitHub
#52 (comment).

Scott Ko | Engineering | apigee http://apigee.com/ | m:
+1.408.393.6675 | twitter @apigee https://twitter.com/apigee

@whitlockjc
Copy link
Member

This has been fixed but I don't see how this is happening in a127. This is an error in sway (that was fixed) but sway isn't used by a127.

@dan-kez
Copy link

dan-kez commented Nov 22, 2016

I'm also receiving this error

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

No branches or pull requests

3 participants