-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
💬 Question here
Would you consider updating the schema response config to also support a response per the request "accept" header?
const schema = {
response: {
// Augment the current mapping (status code -> response schema) to support
// status code -> accept header -> response schema
200: {
"application/vnd.bla.v1+json": ...
"*/*": ...
}
}
}
fastify.get("/apples/:id", { schema } , (request, reply) => {
switch (request.header["accept"]) {
case "application/json":
reply.send(...);
break;
case "application/vnd.bla.v1+json":
reply.send(...);
break;
}
});This would also be beneficial when fastify-swagger dynamically generates an OAS v3 definition.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed