lrstanley / entrest

Extension that generates a compliant OpenAPI spec and server implementation
https://lrstanley.github.io/entrest/
MIT License
11 stars 2 forks source link

feat: error when annotations are added to the wrong origin type #11

Closed lrstanley closed 5 months ago

lrstanley commented 5 months ago

How to do this? In GetAnnotation() functions, somehow? Could use struct tags to help enforce where those things can be set?

Example:

type Annotation struct {
    Sortable        bool        `json:",omitempty" ent:"field"`
    Skip            bool        `json:",omitempty" ent:"schema,edge,field"`
    ReadOnly        bool        `json:",omitempty" ent:"field"`
    Operations      []Operation `json:",omitempty" ent:"schema,edge"`
}