Skip to content

Short-circuit JSON documents to avoid YAML parser #1447

@darrelmiller

Description

@darrelmiller

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions