google / google/gnostic

Define validation annotations and required fields

Open
#267 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.3k
Forks
279
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.