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

Short-circuit JSON documents to avoid YAML parser #1447

Closed
Tracked by #1434
darrelmiller opened this issue Oct 31, 2023 · 0 comments
Closed
Tracked by #1434

Short-circuit JSON documents to avoid YAML parser #1447

darrelmiller opened this issue Oct 31, 2023 · 0 comments
Assignees
Labels
type:breaking-change An issue that will result in dependent client projects failing. V2-Enhancement
Milestone

Comments

@darrelmiller
Copy link
Member

Now that ParseNode is a wrapper around JSON Node and not YAML node we can improve performance for JSON documents by avoiding the YAML parser. We can only do this when we know that the input document is JSON.

To determine if we can parse the JSON directly we use the following heuristics:

  • If the file path ends in ".json" we assume it is JSON content
  • If the http URL ends in ".json" we assume it is JSON content
  • If the HTTP request returns a response content type that is either "application/json" or ends in "+json" then we assume the content is JSON.

All string comparisons can be case insensitive.

@darrelmiller darrelmiller added this to the NET:2.0 milestone Oct 31, 2023
@MaggieKimani1 MaggieKimani1 self-assigned this Nov 1, 2023
@MaggieKimani1 MaggieKimani1 added the type:breaking-change An issue that will result in dependent client projects failing. label Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:breaking-change An issue that will result in dependent client projects failing. V2-Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants