Comments (3)
@aleksicmarija @quadgod I've put up a proposed implementation at #382, let me know what you think. I opted to use the existing struct over adding variable arguments to all the registration functions so I'm curious if that works for you or why you might prefer other ways of doing it.
from huma.
@aleksicmarija do you have an example of what this would look like?
from huma.
Hi @danielgtaylor. I am also looking how to add middleware for specific route.
huma.Register(app, huma.Operation{
OperationID: "registration",
Method: http.MethodPost,
Tags: []string{"account"},
Path: path,
Summary: "Register a new account",
Description: "Register a new account by email and password",
DefaultStatus: http.StatusCreated,
}, func(ctx context.Context, input *RegistrationPayload) (*struct{}, error) {
return nil, nil
}, ...here would be nice to have some code to register middlewares)
Or maybe i misunderstood documentation? Now i see it's only possible to add global middlewares.
from huma.
Related Issues (20)
- Docs UI doesn't handle multiple cookies properly HOT 1
- Allow custom Transform for nested objects HOT 2
- Error thrown when setting cli name HOT 2
- Error return for huma.StreamResponse.Body HOT 1
- Schema(r huma.Registry) *huma.Schema not working on Pointer
- Validation errors localization HOT 2
- Question: Is there a way to add comments to fields? HOT 1
- Version Chi v4 Into Separate Release
- Removing schema reference in response HOT 2
- Multiline doc description for struct fields
- Bug: API doc hidden is not *real* hidden HOT 1
- Allow custom query param types.
- Required query parameter not going through validation when it is omitted HOT 1
- Generating Huma Code from OpenAPI Spec HOT 2
- Generating the openapi.json offline HOT 2
- Defining Servers Causes 404 from OpenAPI Endpoint HOT 1
- Unexported Fields in Schemas are Not Considered for Schema Generation HOT 2
- Any sample code to get http.Request.RemoteAddr in huma.context
- The validation of format:"email" is not perfect. HOT 3
- The default error response field value in openapi docs is "DEFAULT" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from huma.