Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: enum[] are sometimes parsed as element[] in component.config.metadata.json #2606

Open
amadeus-pmeneguzzi opened this issue Dec 17, 2024 · 0 comments
Labels
bug Something isn't working priority:low

Comments

@amadeus-pmeneguzzi
Copy link

Package name

extractors

Package version

latest

Reproduction steps

Hello,

When an enum[] is in a config, sometimes it is parsed by the metadata extractor as a element[].
From my understanding this happens when the enum type is declared outside of the file where the config is declared.

We are regularly seeing blueprint developers coming to us with this error in the metadata file that is resulting in an error when importing the blueprint in the CMS.

It would be nice to have either:

  • a fix to support this use case
  • the extractor to fail the build when the detected type is incompatible with the default value of the property

For sure a fix would be ideal but detecting the use case and failing the build would already be very good for the blueprint developers to detect and fix this issue quickly.

Current result

{
    "description": "The document types of the preferred method",
    "category": "functionalities",
    "label": "preferred Documents",
    "name": "preferredDocuments",
    "type": "element[]",
    "reference": {
        "library": "@refx/kiosk-common",
        "name": "KioskDocumentType"
    },
    "values": [
        "BoardingPass"
    ]
}

Expected result

{
    "description": "The document types of the preferred method",
    "category": "functionalities",
    "label": "preferred Documents",
    "name": "preferredDocuments",
    "type": "enum[]",
    "choices": [
      "BoardingPass"
    ],
    "values": [
        "BoardingPass"
    ]
}

Additional comments

No response

@amadeus-pmeneguzzi amadeus-pmeneguzzi added bug Something isn't working triage labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:low
Projects
None yet
Development

No branches or pull requests

2 participants