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

Swagger module can't handle integer/float info object version #2338

Closed
omusil24 opened this issue Oct 25, 2017 · 6 comments
Closed

Swagger module can't handle integer/float info object version #2338

omusil24 opened this issue Oct 25, 2017 · 6 comments

Comments

@omusil24
Copy link

example:

swagger: '2.0'
info:
  description: some API
  version: '1.0'
  title: Lorem Ipsum API
  contact:
    email: abc@xyz.com

throws: INVALID-FIELD-TYPE: Info Object: "version" field has invalid type "float"; expecting "string"

@omusil24 omusil24 added this to the 0.8.13.1 milestone Oct 25, 2017
@omusil24 omusil24 self-assigned this Oct 25, 2017
@omusil24 omusil24 changed the title swagger module can't handle integer/float info object version Swagger module can't handle integer/float info object version Oct 26, 2017
@davidnich
Copy link
Contributor

@omusil24 is this with a yaml or json schema file? could it be due to incorrect yaml or json deserialization of the schema file?

@omusil24
Copy link
Author

YAML... Not sure. The '1.0' got transformed into float when parsing. Not sure if it's a feature of libyaml or it's a bad setting or maybe trying to be smart on the part of Qore.

@omusil24
Copy link
Author

fixed in #2339

@omusil24
Copy link
Author

Also '+420777000666' got parsed into an integer... Or well, anything number-like in the apostrophes. I had to put normal quotes (") around these kind of strings to be interpreted as a string.

@davidnich
Copy link
Contributor

looks like a yaml deserialization issue then:

david@quasar:~/src/qore/git/qore/src$ qore -l yaml -nX 'parse_yaml("'1234'").type()'
"integer"

that should be parsed as a string. I would rather fix this definitively in the yaml module rather than work around it in the Swagger module

@davidnich
Copy link
Contributor

currently we support yaml 1.1: http://yaml.org/spec/1.1/
and single-quoted strings should be deserialized as string values

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

No branches or pull requests

2 participants