Files
redocly-cli/__tests__/lint/no-invalid-schema-examples-string-number-error/snapshot.js
Andriy Leliv 9ebd1a8b01 fix: schema property:example should be validated (#375)
* fix: schema property:example should be validated
* chore: schema-example separate rule
* test: example-schema: string, number, int
* chore: example object in schema test + minor rule fix
* chore: support v3.1.0
* chore: rewrite schema-example-type rule using ajv
* update tests for 3.1
* chore: no-invalid-parameter-examples rule
* fix: reporting
* chore: added disallowAdditionalProperties
* docs: rules no-invalid parameter & schema examples
2021-12-06 11:50:58 +02:00

61 lines
1.5 KiB
JavaScript

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`E2E lint no-invalid-schema-examples-string-number-error 1`] = `
validating /openapi.yaml...
[1] openapi.yaml:30:28 at #/paths/~1my_post/post/requestBody/content/application~1json/schema/properties/prop_string/example
Example value must conform to the schema: type must be string.
28 | prop_string:
29 | type: string
30 | example: 56
| ^^
31 | prop_number:
32 | type: number
referenced from openapi.yaml:29:19
Error was generated by the no-invalid-schema-examples rule.
[2] openapi.yaml:33:28 at #/paths/~1my_post/post/requestBody/content/application~1json/schema/properties/prop_number/example
Example value must conform to the schema: type must be number.
31 | prop_number:
32 | type: number
33 | example: test
| ^^^^
34 | prop_integer:
35 | type: integer
referenced from openapi.yaml:32:19
Error was generated by the no-invalid-schema-examples rule.
[3] openapi.yaml:36:28 at #/paths/~1my_post/post/requestBody/content/application~1json/schema/properties/prop_integer/example
Example value must conform to the schema: type must be integer.
34 | prop_integer:
35 | type: integer
36 | example: 5.34
| ^^^^
37 |
38 | responses:
referenced from openapi.yaml:35:19
Error was generated by the no-invalid-schema-examples rule.
/openapi.yaml: validated in <test>ms
❌ Validation failed with 3 errors.
run \`openapi lint --generate-ignore-file\` to add all problems to the ignore file.
`;