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/OpenAPI 2.0 issue on additional properties #104

Open
benedictbasa opened this issue Jan 28, 2019 · 5 comments
Open

Swagger/OpenAPI 2.0 issue on additional properties #104

benedictbasa opened this issue Jan 28, 2019 · 5 comments

Comments

@benedictbasa
Copy link

When the addtionalProperties is used for specifying dynamic fields in the swagger 2.0 spec, it is encountering issue.

@jprobinson
Copy link
Contributor

Howdy @benedictbasa. Without more information, I'm afraid I can't resolve this issue.

Would you mind please providing:

  1. The error you encountered.
  2. An example input that triggered this error.
  3. An example of the output you expected for the .proto file afterwards.

Thanks!

@sukidesuaoi
Copy link

sukidesuaoi commented Jan 30, 2019

Hi @jprobinson, we are using object as type for the additionalProperties.

  1. Error encountered:
    type_object_additionalproperties

  2. Example of input:
    image

@jprobinson
Copy link
Contributor

Hi @sukidesuaoi, I'm afraid with this information, I'm unable to reproduce the error.

Can you please provide more context on your input schema, or at least an example schema that forces a similar error?

Also, I'm still unsure what you mean by "dynamic fields" in the issue description. Can you please include what you're expecting of the outputted Protobuf as well?

@sukidesuaoi
Copy link

Hi @jprobinson attaching here a sample of the json file. (Putting it as a txt file)
addProp.txt

The dynamic fields i'm referring to is supposedly like this:
map<string,google.protobuf.Any> Attributes = 31;

@melissop
Copy link

melissop commented Mar 27, 2019

Hi @jprobinson ,
I get the same error while trying to generate a proto file using command below:
openapi2proto -spec TS29510_Nnrf_NFManagement-Swagger20.json > TS29510_Nnrf_NFManagement-Swagger20.proto

The error I get is
error: failed to transpile: failed to compile OpenAPI spec to Protocol buffers: failed to compile definitions: failed to compile #/definition/NfInstancesResponse: failed to compile properties for NfInstancesResponse: failed to compile property _links: failed to compile object property _links: failed to get type [object]: failed to find type object

additionalProperties type is object in my case also.

Attaching the input file with txt suffix.

TS29510_Nnrf_NFManagement-Swagger20.json.txt

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

4 participants