Clarify `allowEmptyValue`
See original GitHub issueFrom the specification it is a little ambiguous what the allowEmptyValue
entails, notably what empty
means:
- is a string containing only whitespaces considered empty?
- does it only affect a
query
parameter when its value is oftype: string
? Or would0
,false
,[]
or{}
qualify asempty
when aquery
parameter is of anothertype
?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:19 (16 by maintainers)
Top Results From Across the Web
java - Correcting Springfox setting allowEmptyValue on path ...
The issue is that the swagger document generated by springfox (2.9.2) has a "allowEmptyValue":false which is disallowed on a path parameter ...
Read more >OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false . allowEmptyValue, boolean, Sets the ...
Read more >allowEmptyValue - not sending 'null' on update?
I'm getting the string null, when it should be empty. Isomorphic, we are not seeing the behavior that you are describing in our...
Read more >Required, empty fields are mistakenly validated as missing but ...
This PR adds support for allowEmptyValues for String params, ... params that clarifies that the param has been supplied with an empty string....
Read more >medSRS - medical Standard Routing Service
... "required": true, "allowEmptyValue": false, "style": "form", "explode": true, ... It also clarifies whether the standard used is supported by the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So here’s the clarification, and we can add more information in the spec if needed.
allowEmptyValue
means a zero-length value can be provided. This translates to?exampleParam=
and not?exampleParam
. There is no way to describe?exampleParam
, and from what I recall in our discussions on this topic, many @OAI/tsc members claimed that such a thing doesn’t really exist.Combining
allowEmptyValue
withminLength=10
is meaningless as given you are defining a minimum length, 0 isn’t it. Only theminLength
will actually take effect here.As for the follow-up question: yes, a
required
parameter can allow empty values, there’s no contradiction there.@darrelmiller although these relate to OAS 2.0 - two (and only two) Microsoft Azure API definitions specifiy
allowEmptyValue: true
. These are:Perhaps reaching out to find the intent of using the flag in these cases might be an interesting data point?
Only two other API definitions across the whole of APIs.guru (1,400+ definitions) use
allowEmptyValue
so it certainly does not seem to be widely adopted in public APIs.