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

Support swagger annotations for default and required fields #851

Closed
fahernandez opened this issue Jan 17, 2019 · 1 comment
Closed

Support swagger annotations for default and required fields #851

fahernandez opened this issue Jan 17, 2019 · 1 comment

Comments

@fahernandez
Copy link
Contributor

Swagger annotation for default and required fields aren't suportted by the swagger generator tool. The idea is to support the annotations as:

float float_value = 3 [(grpc.gateway.protoc_gen_swagger.options.openapiv2_field) = {description: "Float value field", default: "0.2", required: ['float_value']}];

That will generated the swagger json as:

        {
          "name": "float_value",
          "description": "Float value field",
          "in": "query",
          "required": true,
          "type": "number",
          "format": "float",
          "default": "0.2"
        }
johanbrandhorst pushed a commit that referenced this issue Jan 22, 2019
)

* Adding support for default and required swagger annotation fields:Solves issue #851

* Fixing test for swagger generation

* updating swagger definition

* removing breaking changes over enums

* Adding example for required field as an array
@johanbrandhorst
Copy link
Collaborator

Closed by #852

adasari pushed a commit to adasari/grpc-gateway that referenced this issue Apr 9, 2020
…rpc-ecosystem#852)

* Adding support for default and required swagger annotation fields:Solves issue grpc-ecosystem#851

* Fixing test for swagger generation

* updating swagger definition

* removing breaking changes over enums

* Adding example for required field as an array
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

2 participants