Skip to content

echoopenapi adaptor breaks with path parameters when request option is missing #38

@InSantoshMahto

Description

@InSantoshMahto

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.Request is 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.Request is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions