openapi2proto
openapi2proto copied to clipboard
Unable to set x-global-options which have a boolean value eg. java_multiple_files: true
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
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
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.