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

Properly omit wrappers and google.protobuf.empty from swagger definitions #801

Merged

Commits on Dec 15, 2018

  1. Swagger-gen: Major overhaul of well-known-type handling

    - swaggerSchemaObject.Properties is now optional (pointer), because
      google.protobuf.Empty requires us to set Properties{} instead of nil, because
      this equals in Swagger to an empty JSON object (which is exactly what Empty
      represents and how the gateway treats it). If it's not a pointer, we can't
      distinguish between "not set" (in most cases, we don't want Properties to be
      set, instead usually just .Ref is set), and "set to an empty value e.g.
      Properties{} with length 0). We don't want Properties{} to occur except for
      specific cases, e.g. for Empty.
    - Wrappers and Empty are not rendered as definitions, now also for RPC Method
      input/output. instead, all necessary schema information is provided "in-line"
      via schema.type and schema.properties.
    - Empty is now omitted as well if it's input/output of a RPC Method.
    birdayz committed Dec 15, 2018
    Configuration menu
    Copy the full SHA
    ed0dd91 View commit details
    Browse the repository at this point in the history