[JIRA] (JENKINS-41390) Argument not always in location of error

3 views
Skip to first unread message

kzantow@cloudbees.com (JIRA)

unread,
Jan 24, 2017, 3:04:02 PM1/24/17
to jenkinsc...@googlegroups.com
Keith Zantow created an issue
 
Jenkins / Bug JENKINS-41390
Argument not always in location of error
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2017/Jan/24 8:03 PM
Priority: Minor Minor
Reporter: Keith Zantow

Given this JSON:

{
    "pipeline": {
        "agent": {
            "type": "any",
            "arguments": []
        },
        "stages": [
            {
                "name": "Stage 1",
                "branches": [
                    {
                        "name": "default",
                        "steps": [
                            {
                                "name": "emailextrecipients",
                                "arguments": [
                                    {
                                        "key": "recipientProviders",
                                        "value": {
                                            "isLiteral": true,
                                            "value": [
                                                "asdf"
                                            ]
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

I get this error: pipeline/stages/0/branches/0/steps/0 instance failed to match at least one schema, but the issue is specifically about an incorrect format of the recipientProviders argument.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Jan 24, 2017, 3:25:02 PM1/24/17
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-41390
 
Re: Argument not always in location of error

So the problem is that you're passing an array in for pipeline/stages/0/branches/steps/0/arguments/0/value/value - arguments can be one of the following:

    "positionalArgumentList": {
      "description": "List of values used as positional parameters",
      "type": "array",
      "items": {
        "$ref": "#/definitions/rawArgument"
      }
    },
    "singleArgument": {
      "description": "A single value used as a sole unnamed parameter",
      "$ref": "#/definitions/rawArgument"
    },
    "namedArgumentList": {
      "description": "Name/value argument pairs used as named parameters",
      "type": "array",
      "items": {
        "$ref": "#/definitions/argumentValue"
      }
    }

Where argumentValue and rawArgument are...

    "rawArgument": {
      "description": "The raw value of an argument, including whether it's a constant",
      "type": "object",
      "properties": {
        "isLiteral": { "type": "boolean" },
        "value": {
          "type": [
            "number",
            "string",
            "boolean"
          ]
        }
      },

      "required": ["isLiteral", "value"],

      "additionalProperties": false

    },
    "argumentValue": {
      "description": "The value for an argument",
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "$ref": "#/definitions/rawArgument"
        }
      },
      "additionalProperties": false
    }

So you are quite accurately violating the schema. =)

kzantow@cloudbees.com (JIRA)

unread,
Jan 24, 2017, 3:35:02 PM1/24/17
to jenkinsc...@googlegroups.com

Right, totally understood. The issue is, I believe the path should be pipeline/stages/0/branches/steps/0/arguments/0, rather than pipeline/stages/0/branches/steps/0 so someone could actually figure out the specific thing that is in violation.

andrew.bayer@gmail.com (JIRA)

unread,
Jan 24, 2017, 3:38:01 PM1/24/17
to jenkinsc...@googlegroups.com

Gotcha. Not sure why the schema validation is pointing to pipeline/stages/0/branches/steps/0 rather than pipeline/stages/0/branches/steps/0/arguments/0 - will dig.

andrew.bayer@gmail.com (JIRA)

unread,
Feb 10, 2017, 6:47:01 PM2/10/17
to jenkinsc...@googlegroups.com

Keith Zantow - is this still an issue with 1.0 or later?

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:07 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages