question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The "any" definition in the schema does not allow for `number`

See original GitHub issue

The parameters in a template pipeline have a field, default, defined as "any".

"any" can be seen here: https://github.com/microsoft/azure-pipelines-vscode/blob/2e9781b705725387964e1931d9f52ae455746ca1/service-schema.json#L30-L46

It does not include numeric types. The following pipeline therefore fails validation:

parameters:
- name: vals
  default: [1, 2]
jobs:
- ${{ each val in parameter.vals }}:
  - job: foo
    steps:
    - bash: echo ${{ val }}

My understanding is that the above is valid, and that these values will be coerced to strings appropriately.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
50Wliucommented, Feb 17, 2022

Is that location publicly available?

Nope (most likely for compliance reasons even if there’s nothing stored in it).

Better yet, can you ask the Azure Pipelines developers provide the base schema from a URL where we could GET it and list it in SchemaStore, to cut out the middleman?

This would be great! I’ll defer to @golubev-ivan on this.

I hope you can understand my distaste for mucking around in a support forum when I’m trying to report a bug.

I understand, it’s not very clear that this repository doesn’t own the schema. That’s something we can do better at clarifying. What makes it even trickier is that parts of the schema (builtin tasks at https://github.com/microsoft/azure-pipelines-tasks) are controllable.

This is getting into the weeds, but “accurate-yaml-validation” more-or-less covers three areas:

  • Validation issues with the “core” schema (non-tasks) are out of our control, but the standard has sort of been to keep them open to reduce the number of duplicate issues we get. Moving forward I think the best course of action is still to keep them open, but also to file Developer Community tickets.
  • Validation issues with tasks are also kept open, and we try to be good at upstreaming PRs to azure-pipelines-tasks to fix those, then closing the issue once they’re ingested into the schema endpoint.
  • Validating correctness beyond the schema, such as template expressions, unique stage names, or only using runtime variables when allowed. And technically those issues belong in azure-pipelines-language-server, but again we’re treating this repository as the landing pad because they’re so tightly coupled.

Essentially, it boils down to “this repository is an aggregator of validation-related issues for visibility. We can answer questions, but if you’re looking for something to be fixed, that ultimately needs to happen elsewhere”, elsewhere being Developer Community/azure-pipelines-tasks/azure-pipelines-language-server.

0reactions
mr-dokaracommented, Feb 22, 2022

Hello @sirosen, I’m closing this ticket, since we can’t help you with issues that are related to the schema, our team doesn’t support Azure DevOps YAML schema. Extension in fact is the same consumer of ADO schema as you and all the questions related to schema outside our ownership.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Pipelines Schema does not allow for "number" as a ...
The reason is that number is not listed in the allowed types for definitions/any , so the default parameter value is not allowed...
Read more >
Understanding JSON Schema
JSON Schema is a powerful tool for validating the structure of JSON data. However, learning to use it by reading its.
Read more >
Allow true and false for all schemas (except maybe the root ...
We should allow true and false anywhere a schema is allowed (although requiring an object schema for the root would be reasonable, if...
Read more >
Numeric schema has no format defined
Define format of numeric properties in schemas. This ensures that only parameters of the expected format get passed to the backend. Numeric parameters...
Read more >
How to define a JSON schema that requires at least one of ...
To require at least one of a set of properties, use required inside a series of anyOf options: { "type": "object", "anyOf": [...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found