aws-cloudformation / cloudformation-cli

The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.
Apache License 2.0
318 stars 161 forks source link

Build failing on Writing generated docs step #1057

Open brianchou121 opened 7 months ago

brianchou121 commented 7 months ago

Hi team, one of our properties can be one of multiple types. We have defined it as the following:

"DefaultValue": {
      "oneOf": [
        {
          "type": "array"
        },
        {
          "type": "boolean"
        },
        {
          "type": "object"
        },
        {
          "type": "string"
        },
        {
          "type": "integer"
        }
      ],
      "description": "sampletext"
    },

we are unable to build successfully and it seems to be failing on rpdkGenerateSource in the writing docs generating step.

kddejong commented 7 months ago

if you specify a type of array you will need to specify the items or the shape of the items in that array.

Also worth noting depending on what you are doing and how you want to use it you can specify multiple types at the same layer.

"type": ["array", "string"],
"items": {
  "type": "string"
}

This is technically valid against the schema but how the cli but may result in varying success depending on the language plugins ability to handle different types.

brianchou121 commented 7 months ago

we are looking into defining defaultValue as any type essentially. Is there a more "correct" way of doing this. Technically it could be an array of anything so it would kind of be "inifinitely" nested

brianchou121 commented 7 months ago

also tried using definitions and references but seems like its not possible - any suggestions?