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

schema: #/definitions/any doesn't include all types #570

Closed
karunpoudel-chr opened this issue Mar 1, 2024 · 1 comment
Closed

schema: #/definitions/any doesn't include all types #570

karunpoudel-chr opened this issue Mar 1, 2024 · 1 comment

Comments

@karunpoudel-chr
Copy link

karunpoudel-chr commented Mar 1, 2024

#/definitions/any is defined as

"any": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/any"
}
},
{
"type": "object",
"additionalProperties": true
}
]
},

One of the place it is used is to define default value of parameter

"default": {
"$ref": "#/definitions/any"
},

Default value can also be boolean or number depending upon the type of parameter.

Based on current schema, following parameter is invalid, although azure-pipelines.yml supports it.

parameters:
  - name: myBoolean
    displayName: myboolean
    type: boolean
    default: true

So #/definitions/any should probably be defined as:

    "any": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/definitions/any"
          }
        },
        {
          "type": "object",
          "additionalProperties": true
        }
      ]
    },
@ivanduplenskikh
Copy link
Contributor

The same problem as #566.
I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants