teunmooij / payload-tools

Collection of payload plugins and tools: payload-openapi, payload-swagger, create-payload-api-docs, payload-rbac
https://github.com/teunmooij/payload-tools/#readme
MIT License
94 stars 12 forks source link

[Bug]: (payload-openapi) i18n labels not correct #51

Closed HendrikRoth closed 1 year ago

HendrikRoth commented 1 year ago

Package name

payload-openapi

What happened?

Hej, thanks for your plugins! Found a little issue:

{
  "paths": {
      "/{collection}/{id}": {
        "patch": {
          "summary": "Updates a [object Object]"
        }
      }
  }
}

labels are not always a string. Using i18n, labels is an object:

labels: {
  singular: {
    // ...
  },
  plural: {
     // ...
  }
}

Link: https://payloadcms.com/docs/configuration/i18n

What did you expect

{
  "paths": {
      "/{collection}/{id}": {
        "patch": {
          "summary": "Updates a {collectionlabel.singular.en}"
        }
      }
  }
}

Setps to reproduce

adding i18n labels to a collection.

Tool version

1.0.3

Payload version

1.6.32

Node version

No response

teunmooij commented 1 year ago

Thanks for reporting this issue. I've added support for this scenario and released version 1.0.4 of payload-openapi. You can now set docs as language, else it will use en.