question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing of boolean `additonalProperties` inconsistent with OpenAPI 3.0.0 specification

See original GitHub issue

I’m used to setting "additionalProperties": false from JsonSchema, hence did so in an OpenAPI 3.0.0 file, especially as it’s allowed by the specification.

Using version 2.0.0-SNAPSHOT of swagger-parser-v3 as found on oss.sonatype.org for OpenAPI file validation, I get a parse result message saying that additonalProperties is not of type object.

I’m aware of issue #366, but I think either

  • the parser should accept boolean values for additionalProperties as well or
  • it must be clearly stated in the specification if the parser is supposed to frown upon such values.

In addition, the message is a bit misleading because it is reported only once and only for the top level of the object definiton, even though there were several occurences of "additonalProperties": false on deeper levels of this definition. Providing a more precise location would have helped a lot with debugging this issue.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
slinkydevelopercommented, Jan 13, 2018

There’s a chance to get this fix on upstream before end January? 😄

1reaction
webroncommented, Nov 28, 2017

Sorry about this - just got lost in the mass emails. We’ll try to take a look shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistent validaton of boolean parameters - Bitbucket
Handling of invalid parameters of boolean type is inconsistent - if a parameter is passed with a string value (other than “true“ or...
Read more >
OpenAPI Specification - Version 3.0.3 - Swagger
properties - Property definitions MUST be a Schema Object and not a standard JSON Schema (inline or referenced). additionalProperties - Value can be...
Read more >
Using OpenAPI 3.0 is there a way to link a boolean query ...
I'm mocking this in swagger.com so the frontend dudes I'm working with have a mocked api they can send queries to while I...
Read more >
OpenAPI Specification v3.0.3 | Introduction, Definitions, & More
additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a Schema Object and not a standard JSON...
Read more >
Thesis Hamza Ed-Douibi PDF | PDF | Representational State ...
vendor-neutral, portable, and open specification for describing REST APIs. OAI has succeeded in attracting major companies and the OpenAPI specifi-.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found