Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec: Allow empty scalar for mappings/sequences #451

Conversation

straight-shoota
Copy link
Member

This patch allows empty scalars as values for mappings or sequences in shard.yml.

So this is considered a valid specification:

name: foo
version: 0.1.0
dependencies:

Previously, this caused a YAML parser error: Expected MAPPING_START but was SCALAR at line 3, column 15

There's no change to internal behaviour because empty mappings and sequences were already allowed (dependencies: {}).
So this is just a simple UX feature that avoids errors when for example all dependencies are removed but the dependencies: key isn't.
Both empty string and YAML null value (~) are accepted.

@straight-shoota straight-shoota merged commit 7ff1571 into crystal-lang:master Dec 10, 2020
@straight-shoota straight-shoota deleted the feature/spec-empty-mapping branch December 10, 2020 23:28
f-fr pushed a commit to f-fr/shards that referenced this pull request Jan 2, 2021
@bcardiff bcardiff added this to the vNext milestone Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants