Skip to content

Chi: generate Unimplemented implementation#1090

Merged
1 commit merged intooapi-codegen:masterfrom
lelvisl:master
Jul 28, 2023
Merged

Chi: generate Unimplemented implementation#1090
1 commit merged intooapi-codegen:masterfrom
lelvisl:master

Conversation

@lelvisl
Copy link
Copy Markdown
Contributor

@lelvisl lelvisl commented Jun 6, 2023

Update chi-interface.tmpl to generate an implementation for ServerInterface that always returns a http.StatusNotImplemented.

The Unimplemented server can be used like this (assuming the code is generated in package spec):

type MyAPIServer struct {
  spec.Unimplemented
}

Using Unimplemented is optional, but might help when prototyping APIs or in case the OpenAPI spec is managed in a separate repo and mutliple developers.

grpc-go uses a similar strategy. For example see the examples/route_guide/server/server.go file.

ref: #631

@lelvisl
Copy link
Copy Markdown
Contributor Author

lelvisl commented Jun 14, 2023

@deepmap-marcinr please look at this pr =)

@ghost ghost merged commit 0ac6241 into oapi-codegen:master Jul 28, 2023
debuggerpk pushed a commit to breuHQ/oapi-codegen that referenced this pull request Sep 18, 2023
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant