Skip to content

Commit

Permalink
fix: add requestBody so it is pushed to custom data var
Browse files Browse the repository at this point in the history
  • Loading branch information
Givemeurcookies committed Aug 11, 2024
1 parent fdbe0ad commit 71c02e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/swagger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitkraken/payload-swagger",
"version": "1.4.1",
"version": "1.4.2",
"description": "Swagger plugin for payload cms",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/swagger/src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type { EndpointDocumentation, Example };
type DocumentedEndpoint = Endpoint & EndpointDocumentation;

export function defineEndpoint(endpoint: DocumentedEndpoint): Endpoint {
const { summary, description, responseSchema, errorResponseSchemas, queryParameters, custom, ...rest } = endpoint;
const { summary, description, responseSchema, errorResponseSchemas, requestBody, queryParameters, custom, ...rest } = endpoint;
return {
...rest,
custom: {
Expand All @@ -15,6 +15,7 @@ export function defineEndpoint(endpoint: DocumentedEndpoint): Endpoint {
summary,
description,
responseSchema,
requestBody,
errorResponseSchemas,
queryParameters,
},
Expand Down

0 comments on commit 71c02e2

Please sign in to comment.