Skip to content

feat(std-http): accept Mux interface instead of *http.ServeMux#1720

Merged
jamietanna merged 1 commit into
oapi-codegen:mainfrom
sonalys:1718
Sep 20, 2024
Merged

feat(std-http): accept Mux interface instead of *http.ServeMux#1720
jamietanna merged 1 commit into
oapi-codegen:mainfrom
sonalys:1718

Conversation

@sonalys

@sonalys sonalys commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

Description

As described on Issue #1718, I'm implementing receiving Mux as interface instead of *http.ServeMux.
Following the open-closed principle, it will allow the library to be more customizable for the developers.

Comment thread pkg/codegen/templates/stdhttp/std-http-handler.tmpl Outdated
Comment thread pkg/codegen/templates/stdhttp/std-http-handler.tmpl Outdated
}

// ServeMux is an abstraction of http.ServeMux.
type ServeMux interface {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this need to be exported? Probably no big deal it is, but thought I'd ask

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It’s good since you use it in the method’s arguments.

@jamietanna jamietanna left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks! 1 comment then :shipit:

@jamietanna jamietanna added this to the v2.4.0 milestone Aug 19, 2024
@jamietanna jamietanna added the enhancement New feature or request label Sep 19, 2024
@jamietanna jamietanna changed the title feat(std-http): accept Mux as interface instead of *http.ServeMux feat(std-http): accept Mux interface instead of *http.ServeMux Sep 20, 2024
@jamietanna jamietanna enabled auto-merge (squash) September 20, 2024 10:11

@jamietanna jamietanna left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants