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

Fix YAML::Schema::FailSafe.parse and parse_all and add specs #6790

Merged
merged 2 commits into from Sep 25, 2018

Conversation

wooster0
Copy link
Contributor

@wooster0 wooster0 commented Sep 24, 2018

Fixes #6786

Currently both YAML::Schema::FailSafe.parse and YAML::Schema::FailSafe.parse_all raise errors even if correct arguments are given.

In parse using first? probably used to work but doesn't work anymore. So [0]? is now used instead.
At parse_all the wrong return type is specified. It must be Array(Any).

This also adds a new file called fail_safe_spec.cr with specs for parse and parse_all.

@bcardiff
Copy link
Member

@r00ster91 would you mind adding a minimal spec to stress that path?

@wooster0 wooster0 changed the title Use [0] instead of first? in YAMLs cast_document method Fix YAML::Schema::FailSafe.parse and parse_all and add specs Sep 24, 2018
@RX14
Copy link
Contributor

RX14 commented Sep 25, 2018

Looks OK, this regression was probably from making JSON::Type not a recursive alias and removing Indexable from Any.

@RX14 RX14 added this to the 0.27.0 milestone Sep 25, 2018
@RX14 RX14 merged commit 78c1868 into crystal-lang:master Sep 25, 2018
ezrast pushed a commit to ezrast/crystal that referenced this pull request Oct 2, 2018
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