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

JEP-17 JSON functions (GorillaStack) #6

Closed
wants to merge 1 commit into from

Conversation

springcomp
Copy link
Contributor

JSON Functions (GorillaStack)

JEP 17
Author Chris Armstrong (Gorilla Stack)
Status draft
Created 31-10-2019

Abstract

This document proposes adding functions for manipulating JSON data, including
a parse_json and to_json function.

Motivation

There is separate requirements to both parse JSON strings and to serialise
full or partial object structures to JSON.

Specification

The following functions will be added to the specification:

parse_json

any parse_json(string $json_data)

Parse string $json_data containing JSON data and produce an object structure that can be
further manipulated by JMESPath.

If the string contains invalid JSON, an error should be generated.

to_json

string to_json(any $value)

Serialise $value to a JSON string. No guarantees are made about formatting - this is
implementation dependent.

Impact

Although this introduces no changes to existing syntax or functions, it may be challenging
to support correctly in implementations other than JavaScript if the underlying language
does not contain a spec-compliant JSON parser or producing arbitrary object structures for
use with JMESPath is difficult.

@springcomp springcomp added function Function proposal JEP-17 labels Mar 1, 2022
@springcomp springcomp changed the title JSON functions (GorillaStack) JEP-17 JSON functions (GorillaStack) Mar 1, 2022
@springcomp
Copy link
Contributor Author

I think this presents a challenge in how we represents JSON data.
Is this a json-value from the specification ?
Is this a regular string ? Is escaping required ?

@springcomp springcomp marked this pull request as draft May 16, 2022 20:32
@springcomp
Copy link
Contributor Author

Closed in favor of corresponding discussion.

@springcomp springcomp closed this Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
function Function proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant