Repository navigation
Releases
Releases · sakib412/ekman
v0.2.0
Three gaps found by the first production consumer, closed without new dependencies.
Added
ekman.Enum(EnumValues() []string): named string types becomecomponents.schemas
entries withenum, soopenapi-typescriptemits unions.Handlerejects other values:
400invalid_paramfor path/query/header parameters, 422invalid_inputfor JSON body
fields at any depth (keys likeitems[0].kind), merged withValidate.""passes. Enum
types with no or duplicate values fail at boot.- Typed handlers can take the request: an exported
Infield of type*http.Requestreceives
it and leaves the body unread (multipart uploads withstorage.Receive). Such anInmay not
have JSON body fields; that, a second request field or a tagged one fail at boot. ekman.Accepts[T](mediaType)andekman.Produces[T](mediaType)route options document
bodies the handler reads or writes itself (Raw routes;Acceptsalso on request-taking
Handleroutes).ekman.Filestands for binary data (format: binary),stringfor text.
RouteInfo.Accepts/RouteInfo.Produces([]ekman.Content) expose them to middleware.Options.OpenAPIHook func(doc map[string]any) erroredits the generated document once at
boot;/openapi.jsonandApp.OpenAPIboth carry the result.ekmantest.Client.WithHeader(key, value)for requests that need extra headers, such as a
multipartContent-Type.examples/todoexercises all of the above: aPriorityenum,PUT /todos/{id}/attachment
upload,GET /todos.csvexport, and aserversentry added by the hook.
Changed
- Operations whose JSON body contains an
Enumlist a 422 response even whenInhas no
Validatemethod. storage.Receivemay now be called from aHandleroute (through the*http.Requestfield)
as well as fromRouter.Raw.
Full changelog: v0.1.0...v0.2.0