emicklei / go-restful-openapi

OpenAPI extension in Go for the go-restful package
MIT License
135 stars 73 forks source link

support data format for structs (#72) for v2 #73

Closed stevijo closed 3 years ago

stevijo commented 3 years ago

Declaring only the type might be sometimes ambiguous. For example, an UUID will typically be serialized as a string, but just declarding it as such might be unnecessarily ambiguous for an API user.

Using the builder API, it is already possible to declare a format for path parameters (with DataFormat()), but for structs there was no corresponding tag so far.

See https://swagger.io/specification/v2/#dataTypeFormat