Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Fixed parsing new JSON output of debug:config not possible #50637

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

Merged
merged 1 commit into from
Jun 24, 2023

Conversation

Toflar
Copy link
Contributor

@Toflar Toflar commented Jun 12, 2023

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

See my comment to the original PR which introduced debug:config --format=json: #48457 (comment)

Currently, it's not possible to parse the JSON output (neither is the YAML) which makes --format=json kind of pointless. The argument against this - I guess - is that the JSON format was introduced to make the command independent from the YAML component but still, why is --format an option then?

So I guess by delivering an additional option, we can fix this issue and make it parsable.

(Maybe instead of having --no-tilte we should call it parsable in the first place so that if in the future there's something on top of the title, the option would still be valid?)

@stof
Copy link
Member

stof commented Jun 12, 2023

The title should be only for the text format IMO

@Toflar
Copy link
Contributor Author

Toflar commented Jun 12, 2023

There is no text format. The default is yaml and it hasn't been parsable ever since. Now in 6.3, there's a new fallback to json in case the Yaml component is not installed. But there is also a new --format option.

@stof
Copy link
Member

stof commented Jun 12, 2023

then maybe the title should be removed or be an info written to stderr instead of stdout

@Toflar
Copy link
Contributor Author

Toflar commented Jun 12, 2023

I don't really see any value in the title either but I don't feel like I'm in charge to decide on this 😄

@ro0NL
Copy link
Contributor

ro0NL commented Jun 12, 2023

maybe show title if --format is not given

or put different, the default format can be new text which shows title+yaml, but --format=yaml shows no title

@Toflar
Copy link
Contributor Author

Toflar commented Jun 12, 2023

I like that suggestions so I've quickly implemented a first version - wdyt?

@carsonbot carsonbot changed the title Fixed parsing new JSON output of debug:config not possible [FrameworkBundle] Fixed parsing new JSON output of debug:config not possible Jun 21, 2023
@fabpot fabpot force-pushed the fix/broken-json-output-in-config-command branch from 26ebc65 to a3e8560 Compare June 24, 2023 09:59
@fabpot
Copy link
Member

fabpot commented Jun 24, 2023

Thank you @Toflar.

@fabpot fabpot merged commit 1cbfc29 into symfony:6.3 Jun 24, 2023
@fabpot fabpot mentioned this pull request Jun 26, 2023
@Toflar Toflar deleted the fix/broken-json-output-in-config-command branch October 2, 2023 07:26
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.

6 participants