gnostic
gnostic copied to clipboard
Define validation annotations and required fields
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?
Is this problem solved?
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.