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

Unable to set x-global-options which have a boolean value eg. java_multiple_files: true #88

Open
bob9 opened this issue Aug 15, 2018 · 2 comments

Comments

@bob9
Copy link

bob9 commented Aug 15, 2018

Unable to set x-global-options which are booleans like java_multiple_files: true

Error returned is.
error: failed to transpile: failed to load OpenAPI spec: failed to decode content: json: cannot unmarshal bool into Go struct field Spec.x-global-options of type string

example from top of swagger yaml package name works fine.

x-global-options:
  java_package: com.mypackagename
  java_multiple_files: true # THIS CAUSES THE ERROR
@jprobinson
Copy link
Contributor

Hopefully this is just a matter of changing the type of our global options to being an interface{} instead of a string here: https://github.com/NYTimes/openapi2proto/blob/master/openapi/interface.go#L28-L30

@lestrrat
Copy link
Contributor

We're just outputting a text file, why do we need to use a native boolean type there?
This would be different if the tools' aim was to parse and then allow end users to process the data, but we're just producing text.

Documentation can be updated, certainly, but I feel the user should just supply a string there.

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

3 participants