Class: Grpc::Gateway::ProtocGenOpenapiv2::Options::JSONSchema

Inherits:
Object
  • Object
show all
Extended by:
Protobug::Message
Defined in:
lib/grpc/gateway/protoc_gen_openapiv2/options/openapiv2_pb.rb

Overview

‘JSONSchema` represents properties from JSON Schema taken, and as used, in the OpenAPI v2 spec.

This includes changes made by OpenAPI v2.

See: github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject

See also: cswr.github.io/JsonSchema/spec/basic_types/, github.com/json-schema-org/json-schema-spec/blob/master/schema.json

Example:

message SimpleMessage {
  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
    json_schema: {
      title: "SimpleMessage"
      description: "A simple message."
      required: ["id"]
    }
  };

  // Id represents the message identifier.
  string id = 1; [
      (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        description: "The unique identifier of the simple message."
      }];
}

Defined Under Namespace

Classes: FieldConfiguration, JSONSchemaSimpleTypes