AEM forms do not support "oneof" JSON Schema property ? | Community
Skip to main content
Level 4
September 20, 2018
Solved

AEM forms do not support "oneof" JSON Schema property ?

  • September 20, 2018
  • 6 replies
  • 3585 views

I am trying to create a datamodel using the json generated by swagger. However I am getting an error while creating it and looks like "oneOf" property is the issue. I have gone through the below adobe doc about it.

Adobe Experience Manager Help | Creating adaptive forms using JSON Schema

So it says currently AEM forms do not support the folllowing:

  • Null type
  • Union types such as any, and
  • OneOf, AnyOf, AllOf, and NOT
  • Only Homogenous arrays are supported. So, the items constraint must be an object and not be an array.

But AllOf property worked fine. The issue was only with oneOf property. So did adobe fix the "allOf" property though it was mentioned that its not supported. Also in the same way is adobe planning to release any service pack which will fix the "oneOf" property as well ?

Below is the examaple schema of the one of and all of property mentioned in my swagger:

AllOf:

   "StateIssued": {

      "allOf": [

        {

          "$ref": "#/definitions/BaseDocument"

        },

        {

          "type": "object",

          "required": [

            "stateIssuedId"

          ],

          "properties": {

            "stateIssuedId": {

              "type": "string",

              "minLength": 3,

              "maxLength": 25,

              "example": "333224444",

              "description": "-> State that issues the identity document"

            }

          }

        }

      ]

    },

OneOf:

  "IdentityDocument": {

      "type": "object",

      "oneOf": [

        {

          "$ref": "#/definitions/StateIssued"

        },

        {

          "$ref": "#/definitions/DriverLicense"

        },

        {

          "$ref": "#/definitions/Tax"

        },

        {

          "$ref": "#/definitions/Military"

        }

      ]

    },

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Gandhi

Things are already in the discussion but difficult to comment on an upgrade to OpenAPI as of now and yes 'allOf' is supported with FDM. We are working on publishing a document for the supported constructs with FDM. The earlier document which you were referring to for 'allOf' was just for Adaptive forms based on Json schema and Not FDM .

Hope this helps with the query raised earlier.

6 replies

Mayank_Gandhi
Adobe Employee
Adobe Employee
September 21, 2018

Hi Rohit,

I will test this internally and let you know.  Meanwhile, can you confirm what's the forms add-package deployed at your end?

nalla0109Author
Level 4
September 21, 2018

This is the package which I have installed on my local server.

adobe-aemfd-win-pkg-4.1.74.zip (AEM-FORMS-6.3.2.2-WIN-4.1.74.zip)

Mayank_Gandhi
Adobe Employee
Adobe Employee
September 24, 2018

So, what I can find out is that forms is using OpenApI 2.0 and oneof was introduced in 3.0. However, I am checking internally about 'allOf' further.

Thanks

nalla0109Author
Level 4
September 24, 2018

Thanks for the update. Any idea on when forms is going to start using OpenApI 3.0 ?

Mayank_Gandhi
Adobe Employee
Mayank_GandhiAdobe EmployeeAccepted solution
Adobe Employee
September 27, 2018

Things are already in the discussion but difficult to comment on an upgrade to OpenAPI as of now and yes 'allOf' is supported with FDM. We are working on publishing a document for the supported constructs with FDM. The earlier document which you were referring to for 'allOf' was just for Adaptive forms based on Json schema and Not FDM .

Hope this helps with the query raised earlier.

nalla0109Author
Level 4
September 30, 2018

This helps. Thanks !!