Closed klapec closed 1 year ago
Thanks for reporting. I'll look into it asap
I'm experiencing issues with the latest version on payload
"payload": "^1.10.0",
"payload-openapi": "^1.1.3",
"payload-swagger": "^1.0.5",
Both payload-openapi
and payload-swagger
reporting the same problem
/Users/antonio/Development/nextjs-payloadcms-demo/apps/backend/node_modules/payload-openapi/dist/schemas/entity-to-schema.js:4
return new (P || (P = Promise))(function (resolve, reject) {
^
TypeError: (0 , utilities_1.entityToJSONSchema) is not a function
at /Users/antonio/Development/nextjs-payloadcms-demo/apps/backend/node_modules/payload-openapi/dist/schemas/entity-to-schema.js:41:59
at Generator.next (<anonymous>)
at /Users/antonio/Development/nextjs-payloadcms-demo/apps/backend/node_modules/payload-openapi/dist/schemas/entity-to-schema.js:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/antonio/Development/nextjs-payloadcms-demo/apps/backend/node_modules/payload-openapi/dist/schemas/entity-to-schema.js:4:12)
at entityToSchema (/Users/antonio/Development/nextjs-payloadcms-demo/apps/backend/node_modules/payload-openapi/dist/schemas/entity-to-schema.js:40:52)
at /Users/antonio/Development/nextjs-payloadcms-demo/apps/backend/node_modules/payload-openapi/dist/payload-config/routes/collection/main-routes.js:115:97
at Generator.next (<anonymous>)
at fulfilled (/Users/antonio/Development/nextjs-payloadcms-demo/apps/backend/node_modules/payload-openapi/dist/payload-config/routes/collection/main-routes.js:5:58)
[nodemon] app crashed - waiting for file changes before starting...
It's using a super simple project, it's available here https://github.com/TopHatCroat/nextjs-payloadcms-demo/tree/openapi-docs
Payload openapi uses payloads entityToJSONSchema
, which is also used to generate the typescript definitions, to generate parts of the openapi document. This function is part of payloads public interface.
I've published a new version of payload-swagger
and payload-openapi
that fixes this bug.
However, payload version 1.9.3 - 1.10.1 contain a bug. Openapi documentation will not work with those version. The next version of payload contains the fix for that bug, but has not yet been published.
Hi @teunmooij, the payload tool has deployed a new version 1.10.2, which includes a fix. I'm wondering if this version is compatible with the latest version of payloadtools?
I haven't tested this version yet, but yes, it should be.
Tested. It's compatible
Can confirm, everything works fine. Thanks!
Package name
payload-swagger
What happened?
I'm getting
after updating payload to 1.9.1 (latest as of writing this bug report). Apparently you're calling payload's
entityToJSONSchema
without passing down the third required parameter -fieldDefinitionsMap
.What did you expect
No response
Setps to reproduce
payload-swagger@1.0.5
payload@1.9.0
interfaceName
to a field configurationTool version
1.0.5
Payload version
1.9.1
Node version
No response