-
Notifications
You must be signed in to change notification settings - Fork 53
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
File included an unresolvable reference #84
Comments
@nomad-software Were you able to resolve this issue for your use case, or do you know what caused this error? |
Nope, it was never resolved. I had to remove the offending parts by had from the Json file before conversion. Luckily I didn't need those particular endpoints. |
Thanks! I found that if I use a recent version of gnostic to create a |
Thanks for the suggestion but that doesn't work on the original file mentioned. |
I believe to have found source of this issue. Definition like this: "DataResult": {
"properties": {
"object": {
"additionalProperties": {
"$ref": "#/definitions/DataResult"
},
"description": "Object value",
"example": "",
"type": "object"
},
"string": {
"type": "string"
},
},
"type": "object"
} Is represented by gnostic-grpc like that: message Object {
map<string, DataResult> additional_properties = 1;
}
message DataResult {
string string = 1;
Object object = 2;
} To do that, gnostic internally generates a type to store Note that it uses Later, gnostic-rpc begins processing a field with name gnostic-grpc/generator/language.go Lines 36 to 38 in c8bc7e1
Since type gnostic-grpc/generator/language.go Lines 81 to 82 in c8bc7e1
But later on gnostic-grpc/generator/generator_messages.go Lines 162 to 164 in c8bc7e1
Obviously, this results in an invalid proto file since it does not contains a definition for a I've fixed the issue for me by changing the first snippet to prefix generated type name with it's containing type name. fieldTypeName := fmt.Sprintf("%s_%s", name, namedSchema.Name)
fieldInfo := b.buildFromSchemaOrReference(fieldTypeName, namedSchema.Value)
makeFieldAndAppendToType(fieldInfo, schemaType, namedSchema.Name) |
Same issue. This path worked for me. Thanks for the help! Strange that the invocation of |
I'm trying to convert the following Json file: https://github.com/oracle/hospitality-api-docs/blob/main/rest-api-specs/property/lov.json
Using this command:
and i'm getting this error:
If I then try the
--resolve-refs
option like this:I get another slightly different error:
There's another file that has problems too:
https://github.com/oracle/hospitality-api-docs/blob/main/rest-api-specs/property/fofcfg.json
but the rest convert correctly. Any ideas on what is happening here as the Json files seem to be valid?
Thanks.
The text was updated successfully, but these errors were encountered: