Skip to content

Failed to generate graphql typesΒ #498

@rogalmic

Description

@rogalmic

Hi,

With newest umbraco forms openapi schema, I cannot generate schema:

const openApiSchema = await response.json();
  const formTypes = await openApiToGraphql(openApiSchema);

Attaching the json from response used above. umbraco_forms_api_openapi.zip

Seems the issue is that enums inside "oneOf" are failing:

          "fieldIndicationType": {
            "description": "Gets or sets the form's field mandatory or optional field indication type.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/FormFieldIndication"
              }
            ]
          },



...

      "FormFieldIndication": {
        "type": "integer",
        "description": "Enumeration for field indications.",
        "x-enumNames": [
          "NoIndicator",
          "MarkMandatoryFields",
          "MarkOptionalFields"
        ],
        "enum": [
          0,
          1,
          2
        ]
      },

There is an exception in createOrReuseEnum(), enum is undefined (expanding schema):
image

Is that so that enum cannot be part of complex type?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions