chridou / http-api-problem

A problem type to be returned by HTTP APIs
Apache License 2.0
53 stars 12 forks source link

OpenAPI support via `schemars` #37

Closed SohumB closed 2 years ago

SohumB commented 2 years ago

This PR implements openapi support for HttpApiProblem, and, optionally, OpenApiResponder support for the rocket-okapi crate. In rapidoc, the resulting schema looks like this: image

I've implemented the schema under a feature flag, under the assumption that you'd prefer to not add dependencies to your clients if they're not intending on using them.

chridou commented 2 years ago

Thanks!

I think I will have to make the derive lib an own crate to be published in order to publish the new features.