google / google/gnostic

response_or_reference ref is not generated correctly

Open
#437 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.3k
Forks
279
PR merge metrics
No merged PRs in 30d

Description

Hey there,
So I have this in my proto file:
```
responses: {
response_or_reference: {
name: "default"
value: {
response: {
content: {
additional_properties: [{
value: {
schema: {
reference: { _ref: "#/components/schemas/ErrorResponse"; }
}
}
}]
}
}
}
}
}
```

and
```
message ErrorResponse {
string message = 1 [(google.api.field_behavior) = REQUIRED];
}
```

ErrorResponse is being generated into go code, but when I run protoc with openapi ErrorResponse is not being added to components (it's not being used anywhere besides the code above)
Is there any way to force openapi generator to add all structs into the components?

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.