Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional_properties: true not generating correct doc #55

Closed
bopm opened this issue May 8, 2019 · 5 comments
Closed

additional_properties: true not generating correct doc #55

bopm opened this issue May 8, 2019 · 5 comments

Comments

@bopm
Copy link
Contributor

bopm commented May 8, 2019

I have next definition:

schema FreeFormObj: {
  type: Object,
  additional_properties: true
}

I wait it to generate next valid doc:

"FreeFormObj": {
  "type": "object",
  "additionalProperties": true
}

but instead, it generates invalid one:

"FreeFormObj": {
  "type": "object",
  "additionalProperties": {
    "type": "true"
  }
}
@zhandao
Copy link
Owner

zhandao commented May 9, 2019

additionalProperties should be a SchemaObject.

true is invalid.

@zhandao zhandao closed this as completed May 9, 2019
@bopm
Copy link
Contributor Author

bopm commented May 9, 2019

No it's not, according to https://swagger.io/specification/ :

additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema. Consistent with JSON Schema, additionalProperties defaults to true.

Also: OAI/OpenAPI-Specification#668 (comment)

True means that definition is open ended. Any property can be added. I am using doc to generate ruby client with openapitools/openapi-generator and it's handling true value like it supposed to. But now I need to manually replace code generated with gem to correct format.

@zhandao zhandao reopened this May 9, 2019
@zhandao
Copy link
Owner

zhandao commented May 9, 2019

Oh, sorry. I'll fix it.

@bopm
Copy link
Contributor Author

bopm commented May 9, 2019

Not a problem, thanks for all your work!

@zhandao
Copy link
Owner

zhandao commented May 9, 2019

New version released 😄

@zhandao zhandao closed this as completed May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants