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

Can toJson() functionality be included as well? #17

Open
thosakwe opened this issue Jul 14, 2018 · 6 comments
Open

Can toJson() functionality be included as well? #17

thosakwe opened this issue Jul 14, 2018 · 6 comments
Assignees
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) type-enhancement A request for a change that isn't a bug

Comments

@thosakwe
Copy link

It's fantastic to have an official package on Pub for parsing and extracting data from a pubspec.

There is, however, one thing, I'm wondering - would it be bad for createToJson to be true for the models contained in this package?

I'm working on updating the Angel CLI, which uses the old package:pubspec to persist changes to the project files (namely, adding dependencies the user is missing), to pubspec_parse, and if there were some way to just get a toJson method on the PubSpec.

I'll gladly send a PR, but is there is a specific reason this functionality isn't present already? I imagine there's probably a reason I didn't think about.

@kevmoo
Copy link
Member

kevmoo commented Jul 21, 2018

Hey @thosakwe

I think I avoided toJson because the pubspec is yaml – and the json output wouldn't necessarily round-trip the shape of the source.

There is quite a bit of special handling of dependencies, for instance.

If you want to take a shot, I'd accept a PR, though!

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug good first issue A good starting issue for contributors (issues with this label will appear in /contribute) labels Jul 21, 2018
@AliAkberAakash
Copy link

@kevmoo could I work on this issue?

@kevmoo
Copy link
Member

kevmoo commented Feb 5, 2023

@kevmoo could I work on this issue?

Sure! Just make sure you put in plenty of tests. I want to see that at round trips cleanly, etc.

@alestiago
Copy link

Is this being worked on? (cc: @AliAkberAakash , @kevmoo )

@AliAkberAakash
Copy link

Hey @alestiago I completely forgot about this, No it's not being worked on from my side. If you want we can work on this together.

@alestiago
Copy link

@AliAkberAakash I don't have the bandwidth right now to work on this feature. If I ever have some spare I'll let you know. If you're no longer working on this I recommend asking to get unassigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants