Skip to content
Discussion options

You must be logged in to vote

We have an example here (https://github.com/oapi-codegen/oapi-codegen/tree/main/examples/petstore-expanded/strict), which shows how to build the canonical OpenAPI pet store example on top of a strict-server with the Chi framework as its underlying server.

The main looks like this:
https://github.com/oapi-codegen/oapi-codegen/blob/main/examples/petstore-expanded/strict/petstore.go#L20

A "strict server" is a wrapper around ServerInterface, which performs additional marshaling and validation to make your job easier, so you only need to implement the StrictServerInterface.

The magic happens here, when you create a StrictServer, it returns to you a ServerInterface:
https://github.com/oapi-code…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@GeertsP
Comment options

@GeertsP
Comment options

Comment options

You must be logged in to vote
1 reply
@GeertsP
Comment options

Answer selected by mromaszewicz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants