docs: Clarify how to use StrictServerInterface implementations.#2417
docs: Clarify how to use StrictServerInterface implementations.#2417alex-orange-UofU wants to merge 1 commit into
Conversation
Greptile SummaryThis PR clarifies how strict server implementations are wired into generated server handlers. The main change is:
Confidence Score: 4/5This is close, but the backend-specific helper wording should be fixed before merging.
README.md
|
| 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
| ``` | ||
|
|
||
| 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. |
There was a problem hiding this comment.
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.
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.