Skip to content

docs: Clarify how to use StrictServerInterface implementations.#2417

Open
alex-orange-UofU wants to merge 1 commit into
oapi-codegen:mainfrom
alex-orange-UofU:main
Open

docs: Clarify how to use StrictServerInterface implementations.#2417
alex-orange-UofU wants to merge 1 commit into
oapi-codegen:mainfrom
alex-orange-UofU:main

Conversation

@alex-orange-UofU

Copy link
Copy Markdown

As described. Just add a sentence clarifying how to actually use strict servers. I had to ask google gemini how to actually use them, and then after it answered it was obvious in hindsight. One of those things you just have to explain once.

@greptile-apps

greptile-apps Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR clarifies how strict server implementations are wired into generated server handlers. The main change is:

  • Adds README guidance to wrap a StrictServerInterface implementation with NewStrictHandler or NewStrictHandlerWithOptions before using the server examples.

Confidence Score: 4/5

This is close, but the backend-specific helper wording should be fixed before merging.

  • The change is documentation-only.
  • The new guidance can make Echo, Echo v5, Fiber, and Iris users call a helper that their generated code does not define.

README.md

Important Files Changed

Filename Overview
README.md Adds strict-server usage guidance, with one backend-specific helper called out too broadly.

Reviews (1): Last reviewed commit: "docs: Clarify how to use StrictServerInt..." | Re-trigger Greptile

Comment thread README.md
```

We can see that this provides the best means to focus on the implementation of the business logic within the endpoint, rather than (un)marshalling types to and from JSON, or wrangling cookies or headers.
We can see that this provides the best means to focus on the implementation of the business logic within the endpoint, rather than (un)marshalling types to and from JSON, or wrangling cookies or headers. In order to actually use your strict server implementation use `NewStrictHandler` or `NewStrictHandlerWithOptions` to generate a (non-strict) server interface to use with the examples below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Backend helper mismatch

This guidance tells all strict-server users they can use NewStrictHandlerWithOptions, but that helper is not generated for every backend. Echo, Echo v5, Fiber, and Iris strict templates only generate NewStrictHandler, so following this sentence for those servers leads to a compile error like undefined: api.NewStrictHandlerWithOptions. Please qualify this helper as backend-specific, or keep the generic guidance to NewStrictHandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant