-
Notifications
You must be signed in to change notification settings - Fork 327
Description
Describe the bug
In the following schema, the enum has two string values, YES and NO. These values are converted into a boolean because these two values are equivalent replacements in prior versions of YAML. I want to use them as string values in my data instance.
$schema: http://json-schema.org/draft-04/schema#
type: object
additionalProperties: false
required:
- test
properties:
test:
type: string
enum:
- 'YES'
- 'NO'
- JEREMY# yaml-language-server: $schema=test.schema.yaml
test: YESExpected Behavior
The string values should be preserved and not converted to boolean per the 1.2 Specification.
The primary objective of this revision is to bring YAML into compliance with JSON as an official subset. YAML 1.2 is compatible with 1.1 for most practical applications - this is a minor revision. An expected source of incompatibility with prior versions of YAML, especially the syck implementation, is the change in implicit typing rules. We have removed unique implicit typing rules and have updated these rules to align them with JSON's productions. In this version of YAML, boolean values may be serialized as “true” or “false”;
Current Behavior
The string values are converted to boolean, incorrectly.
Steps to Reproduce
- create the schema
- create the test file and add the modeline to assign the schema
- use auto-suggestion to display enum values
- select
YESorNO - observe value is converted to boolean
Environment
- Windows
- Mac
- Linux
- other (please specify)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status

