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

Hurl parser added #511

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Hurl parser added #511

wants to merge 3 commits into from

Conversation

WrathOP
Copy link
Contributor

@WrathOP WrathOP commented Dec 17, 2024

PR Description

In progress hurl parser implementation

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: please replace this line with details on why tests have not been included

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add models.dart inside src/models/ and it should export all models.
That file should be exported here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sure will do that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the source of the grammar. Provide reference to the actual library.
How was this file created? Manually done, AI generated? what resources were used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's grammar available on the Hurl.dev website. Gave that to AI and then it generated a initial code. It was not working of-course and I fixed alot of the parsers and ambiguity in the grammar.(the actual grammar has ambiguity) so that was an issue and testing out entire grammar and fixing it is the real job here.

Copy link
Member

@ashitaprasad ashitaprasad Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the official grammar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashitaprasad
Copy link
Member

All models must used freezed with JsonSerializable options.
Check here - https://github.com/foss42/apidash/blob/main/lib/models/request_model.dart
You can take help of https://app.quicktype.io/

@ashitaprasad
Copy link
Member

Also, did you get a chance to directly integrate hurl Rust library using https://pub.dev/packages/flutter_rust_bridge?

@WrathOP
Copy link
Contributor Author

WrathOP commented Dec 18, 2024

Also, did you get a chance to directly integrate hurl Rust library using https://pub.dev/packages/flutter_rust_bridge?

Nope I didn't check out that way as of now. Will check it out after I get an initial working of this current parser.

@ashitaprasad
Copy link
Member

It is recommended that you proceed in the following manner.
Try integrating the hurlfmt library using flutter_rust_bridge as it will be the best because we will be directly using the upstream project and any changes in the upstream will get reflected.
This library will help format hurl files input by the user into JSON format.
Next, we can build the Dart models for this JSON schema of hurl and use it.

@WrathOP
Copy link
Contributor Author

WrathOP commented Dec 20, 2024

It makes sense to leverage the upstream project, as it ensures we benefit directly from any updates. I'll look into flutter_rust_bridge method and drip this one for the moment.

It is recommended that you proceed in the following manner.
Try integrating the hurlfmt library using flutter_rust_bridge as it will be the best because we will be directly using the upstream project and any changes in the upstream will get reflected.
This library will help format hurl files input by the user into JSON format.
Next, we can build the Dart models for this JSON schema of hurl and use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing Requests from hurl file
2 participants