gnostic icon indicating copy to clipboard operation
gnostic copied to clipboard

Define validation annotations and required fields

Open grizzlybearer opened this issue 4 years ago • 2 comments

I need to define OpenAPI validation annotations on my API resources such as minLength, minItems and also specify the required fields

e.x:

components:
  schemas:
    Resource:
      required:
        - foo
        - bar
      type: object
      properties:
        foo:
          type: string
          description: Some description about foo
          minLength: 1
          maxLength: 200

My proto would look like:

Message SomeProto {
     string foo = 1; // need to define minLength and maxLength
     string bar = 2;
}

Is it possible to define these annotations on the proto?

grizzlybearer avatar Nov 09 '21 15:11 grizzlybearer

Is this problem solved?

sanaex avatar Jan 28 '22 15:01 sanaex

If schema and field annotations are added, similar to how document and operation annotations were added in #324 then this would be solved I think.

jeffsawatzky avatar Apr 05 '22 03:04 jeffsawatzky