Schema validator chokes on numbers in scientific notation
See original GitHub issueRepro:
$ autorest --input-file=https://tripletex.no/v2/swagger.json
Error:
AutoRest code generation utility [version: 2.0.4280; node: v10.4.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
There is a new version of AutoRest available (2.0.4283).
> You can install the newer version with with npm install -g autorest@latest
Loading AutoRest core '/Users/rigibson/.autorest/@microsoft.azure_autorest-core@2.0.4283/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4283)
ERROR: Schema violation: Expected type number but found type string
- https://tripletex.no/v2/swagger.json:1:242238 ($.definitions.TravelExpense.properties.attachmentCount.maximum)
FATAL: swagger-document/individual/schema-validator - FAILED
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
Culprit appears to be this “maximum” property:
"attachmentCount": {
"type": "integer",
"format": "int32",
"readOnly": true,
"minimum": 0.0,
"maximum": 2.147483647E9
},
Related to Azure/autorest.typescript#311
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Schema validation error when using scientific notation e.g."8.0 ...
Schema validation error when using scientific notation e.g."8.0E-4" in a schema element defined as "xsd:decimal" .
Read more >How to Create a 13F XML Information Table using Excel 2010 ...
This reference guide is intended to help filers prepare their Form 13F Information table in order to submit it electronically via EDGAR.
Read more >Number constraints in JSON Schema Validation
I am working of JSON Schema Validation. I wanted to know if it is possible to impose number constraints, and if it is...
Read more >JSON and JSON Schema for XML Developers - xFront
A JSON instance contains a single JSON value. A JSON value may be either an object, array, number, string, true, false, or null:...
Read more >eCPR XML Guidelines
3.2 How to Validate an XML file against the eCPR schema file using XML Notepad. ... Awarding Body ID, Project Number, and Contract...
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 FreeTop 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
Top GitHub Comments
OH FOR &%@(…
My whole life, I thought
exclusiveMinimum
was a number … well, that tells you how many people use it, because the powershell generator and the whole V3 modeler aren’t using it right.At the end of the day, this is so typical of JSON Schema – use two properties, when one would have done.
Ah ok, I got that working. It looks like exclusiveMinimum takes a boolean value along with your minimum, this is what worked for me…
Thanks for the help!