这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mt35-rs
Copy link
Contributor

@mt35-rs mt35-rs commented Dec 1, 2022

Go types can have a . in them but the chi router can't handle this if the non-parameter part of the route starts with (contains?) a .. Given all the potential other special characters in a Go type name (in the context of generics), it was easier to just use a wildcard and check for the proper suffix.

In the future, it would be pretty easy to add support for a .yaml prefix.

The error handler here was pretty bare bones. It didn't respond with RFC 7807 problems, etc. So I made a more consistent error writer.

This is all to address issue #74.

Go types can have a `.` in them but the `chi` router can't handle this if
the non-parameter part of the route starts with (contains?) a `.`.  Given
all the potential other special characters in a Go type name (in the context
of generics), it was easier to just use a wildcard and check for the proper
suffix.

In the future, it would be pretty easy to add support for a `.yaml` prefix.

The error handler here was pretty bare bones.  It didn't respond with
RFC 7807 problems, etc.  So I made a more consistent error writer.

This is all to address issue danielgtaylor#74.
@mt35-rs mt35-rs mentioned this pull request Dec 1, 2022
Copy link
Owner

@danielgtaylor danielgtaylor left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@danielgtaylor danielgtaylor merged commit b7aad43 into danielgtaylor:main Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants