echoopenapi adaptor breaks with path parameters when request option is missing
Issue Summary
When using the echoopenapi adaptor, endpoints with path parameters fail to generate a default schema if option.Request is not provided. This breaks the expected behavior where a default schema should be generated for path parameters even without explicitly specifying a request option.
Example
type JustForDubugging struct {
ID string `path:"id"`
}
router.DELETE("/:id", deleteHandler).With(
option.Request(new(JustForDubugging)),
)
Expected:
- When
option.Requestis not specified, the adaptor should still generate a default schema for the path parameter.
Actual:
- The schema is not generated, causing issues with OpenAPI documentation and potentially client integrations.
Proposed Solution
- Update the echoopenapi adaptor to detect path parameters and generate a default schema, even when
option.Requestis omitted. - Ensure backward compatibility so existing routes without explicit request options do not break.
Additional Context
- This affects routes using path parameters when no request struct is provided via
option.Request. - Might impact automated documentation and client code generation.
echoopenapi is use spec for generating openapi doc, and spec is wrapper from openapi-go, as for error when not set request option at register operation is at openapi-go library, and for support this issue maybe can adjust at openapi-go repo first and then spec repo, or any other option?
likely it possible with same mechanism like this pr, but i think if we support this method it must be added at spec not at adapter, so all adapter has this feature.