Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Yaml] Fix parsing of block scalars in arrays#51444

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

NickSdot
Copy link
Contributor

@NickSdotNickSdot commentedAug 21, 2023
edited
Loading

QA
Branch?5.4/6.3 for bug fixes
Bug fix?yes
New feature?no
Deprecations?no
LicenseMIT

Valid Yaml

anyOf:  -$ref:>-      #/string/barnested:anyOf:    -$ref:>-        #/string/bar

Failing Test diff

 Array &0 (     'anyOf' => Array &1 (         0 => Array &2 (-            '$ref' => ''+            '$ref' => '#/string/bar'         )     )     'nested' => Array &5 (         'anyOf' => Array &6 (             0 => Array &7 (-                '$ref' => ''+                '$ref' => '#/string/bar'             )         )     ) )

Notes

Similar cases that use block scalar folding are correctly handled by the parser. However, if the block scalar folding is in arrays the returned value is an empty string.

An example YAML file which is resulting in a broken parse is the Stripe OpenApi spec whichcan be found here. There are exactly 100 broken values when parsed.

I didn't consider this as a BC break since I assume that an empty string as a return value is in no ones interest. Feel free to let me know if you think otherwise and want me to target another branch.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "5.4" but it seems your PR description refers to branch "6.3 for bug fixes".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

NickSdot added a commit to NickSdot/cebe-php-openapi that referenced this pull requestAug 22, 2023
…lds in reference objects. This is, according to the OpenApi spec, not legal. The lack of throwing an exception in situations like this lead to extra loops and a notable performance hit when working with larger specs like Stripe.
@NickSdot
Copy link
ContributorAuthor

@mtarld, I don't mean to rush you, but I am allowing myself to ping you in case you missed the notification.

Lmk if there is something you would like to see changed in order to get this merged. Thank you.

@mtarld
Copy link
Contributor

Hey@NickSdot!
Everything LGTM, but I am not able to merge PRs on Symfony repository, therefore we must wait for a merger to merge it if everything is ok for her/him 🙂

NickSdot reacted with thumbs up emoji

@NickSdot
Copy link
ContributorAuthor

Sorry for my stupidity, I meant to tag@xabbuh, who is shown as the pending reviewer - not you. 🤦‍♂️ Thanks for jumping in anyway,@mtarld!

mtarld reacted with thumbs up emoji

@xabbuh
Copy link
Member

Thank you very much for working on this@NickSdot and sorry for the late review. I wondered why we actually needed two separate conditions and found out that there was also a little bug inisNextLineIndented(). After fixing that we can also simplify your patch a bit more. I have opened#52408 with these changes. But don't worry I have kept your commit so you will still get the credit for the bugfix.

NickSdot reacted with thumbs up emoji

@xabbuhxabbuh closed thisNov 1, 2023
@NickSdot
Copy link
ContributorAuthor

Thank you very much for working on this@NickSdot and sorry for the late review. I wondered why we actually needed two separate conditions and found out that there was also a little bug inisNextLineIndented(). After fixing that we can also simplify your patch a bit more. I have opened#52408 with these changes. But don't worry I have kept your commit so you will still get the credit for the bugfix.

Thank you for taking this on@xabbuh. Yes, you spotted what I didn't fully understand. ;-)

However, glad a fix got merged!

xabbuh reacted with thumbs up emoji

@NickSdotNickSdot deleted the yaml-block-scalars-array branchNovember 4, 2023 13:09
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mtarldmtarldmtarld approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

4 participants
@NickSdot@carsonbot@mtarld@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp