@nrwl/tao fails to validate schema in case of multiple types
See original GitHub issueI’m using “@nrwl/angular”: “^12.9.0” and “@angular/fire”: “~7.2.0”.
@angular/fire:deploy
accepts the following parameter in its schema:
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "FirebaseDeploySchema",
"title": "Firebase Deploy",
"description": "Ng Deploy target options for Firebase.",
"properties": {
// ...
"ssr": {
"type": ["boolean", "string"],
"description": "Should we attempt to deploy the function to Cloud Functions (true or 'cloud-functions') / Cloud Run ('cloud-run') or just Hosting (false)"
}
}
}
In my angular.json
I have:
"deploy": {
"builder": "@angular/fire:deploy",
"options": {
"prerender": false,
"ssr": false,
"browserTarget": "my-app:build:production",
"firebaseProject": "my-project-id",
}
}
Current Behavior
If I run: nx run my-app:deploy
, it fails:
Property 'ssr' does not match the schema. 'false' should be a 'boolean,string'.
Expected Behavior
It runs successfully. I don’t know if it’s ever worked.
Considerations
I’m pretty sure it depends on validation logic, that does not take into account the possibility of (valid) mutliple types in the schema.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
Correct JSON Schema for an array of items of different type
I don't want to specify an order, just validate the objects within the array, regardless of order or number of objects. From the...
Read more >A Vocabulary for Structural Validation of JSON - JSON Schema
JSON Schema (application/schema+json) has several purposes, one of which is JSON ... possible instance values of the correct type that will fail validation....
Read more >Understanding schema errors | HESA
Schema errors prevent the validation being run in full because the file cannot be ... This type of error is similar to the...
Read more >Schema validation - Postman Quick Reference Guide
Schema validation ¶. This section contains different examples of validating JSON responses using the Ajv schema validator. I do not recommend using the...
Read more >Schema Validation
An XML Schema precisely defines the elements and attributes that constitute an instance XML document. It also specifies the data types of these...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Is there anything I could add?
Actually, I’m referring to multiple types, as per the last example of this page: https://json-schema.org/understanding-json-schema/reference/type.html
The definition of
type
is: