Yashodhr commited on
Commit
ac207e5
·
verified ·
1 Parent(s): 9a99259

Delete md_data.json

Browse files
Files changed (1) hide show
  1. md_data.json +0 -271
md_data.json DELETED
@@ -1,271 +0,0 @@
1
- [
2
- {
3
- "tag": {
4
- "category": "Runtime",
5
- "subcategory": "Cloud Native Network",
6
- "project_name": "Cilium",
7
- "file_name": "MAINTAINERS.md"
8
- },
9
- "content": [
10
- {
11
- "heading": "Maintainers (in alphabetical order)",
12
- "data": "- [cesarghali](https://github.com/cesarghali), Google LLC\n - [dfawley](https://github.com/dfawley), Google LLC\n - [easwars](https://github.com/easwars), Google LLC\n - [menghanl](https://github.com/menghanl), Google LLC\n - [srini100](https://github.com/srini100), Google LLC"
13
- },
14
- {
15
- "heading": "Emeritus Maintainers (in alphabetical order)",
16
- "data": "- [adelez](https://github.com/adelez), Google LLC - [canguler](https://github.com/canguler), Google LLC - [iamqizhao](https://github.com/iamqizhao), Google LLC - [jadekler](https://github.com/jadekler), Google LLC - [jtattermusch](https://github.com/jtattermusch), Google LLC - [lyuxuan](https://github.com/lyuxuan), Google LLC - [makmukhi](https://github.com/makmukhi), Google LLC - [matt-kwong](https://github.com/matt-kwong), Google LLC - [nicolasnoble](https://github.com/nicolasnoble), Google LLC - [yongni](https://github.com/yongni), Google LLC"
17
- },
18
- {
19
- "additional_info": "This page lists all active maintainers of this repository. If you were a maintainer and would like to add your name to the Emeritus list, please send us a PR. See [GOVERNANCE.md](https://github.com/grpc/grpc-community/blob/master/governance.md) for governance guidelines and how to become a maintainer. See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) for general contribution guidelines. - [cesarghali](https://github.com/cesarghali), Google LLC - [dfawley](https://github.com/dfawley), Google LLC - [easwars](https://github.com/easwars), Google LLC - [menghanl](https://github.com/menghanl), Google LLC - [srini100](https://github.com/srini100), Google LLC - [adelez](https://github.com/adelez), Google LLC - [canguler](https://github.com/canguler), Google LLC - [iamqizhao](https://github.com/iamqizhao), Google LLC - [jadekler](https://github.com/jadekler), Google LLC - [jtattermusch](https://github.com/jtattermusch), Google LLC - [lyuxuan](https://github.com/lyuxuan), Google LLC - [makmukhi](https://github.com/makmukhi), Google LLC - [matt-kwong](https://github.com/matt-kwong), Google LLC - [nicolasnoble](https://github.com/nicolasnoble), Google LLC - [yongni](https://github.com/yongni), Google LLC"
20
- }
21
- ]
22
- },
23
- {
24
- "tag": {
25
- "category": "Runtime",
26
- "subcategory": "Cloud Native Network",
27
- "project_name": "Cilium",
28
- "file_name": "MIGRATION_GUIDE.md"
29
- },
30
- "content": [
31
- {
32
- "heading": "Migration Guide (v4.0.0)",
33
- "data": "Starting from [v4.0.0](https://github.com/golang-jwt/jwt/releases/tag/v4.0.0), the import path will be:\n \"github.com/golang-jwt/jwt/v4\"\n The `/v4` version will be backwards compatible with existing `v3.x.y` tags in this repo, as well as\n `github.com/dgrijalva/jwt-go`. For most users this should be a drop-in replacement, if you're having\n troubles migrating, please open an issue.\n You can replace all occurrences of `github.com/dgrijalva/jwt-go` or `github.com/golang-jwt/jwt` with `github.com/golang-jwt/jwt/v4`, either manually or by using tools such as `sed` or `gofmt`.\n And then you'd typically run:"
34
- },
35
- {
36
- "heading": "Older releases (before v3.2.0)",
37
- "data": "The original migration guide for older releases can be found at https://github.com/dgrijalva/jwt-go/blob/master/MIGRATION_GUIDE.md."
38
- },
39
- {
40
- "additional_info": "Starting from [v4.0.0](https://github.com/golang-jwt/jwt/releases/tag/v4.0.0), the import path will be: \"github.com/golang-jwt/jwt/v4\" The `/v4` version will be backwards compatible with existing `v3.x.y` tags in this repo, as well as `github.com/dgrijalva/jwt-go`. For most users this should be a drop-in replacement, if you're having troubles migrating, please open an issue. You can replace all occurrences of `github.com/dgrijalva/jwt-go` or `github.com/golang-jwt/jwt` with `github.com/golang-jwt/jwt/v4`, either manually or by using tools such as `sed` or `gofmt`. And then you'd typically run: ``` go get github.com/golang-jwt/jwt/v4 go mod tidy ``` The original migration guide for older releases can be found at https://github.com/dgrijalva/jwt-go/blob/master/MIGRATION_GUIDE.md."
41
- }
42
- ]
43
- },
44
- {
45
- "tag": {
46
- "category": "Runtime",
47
- "subcategory": "Cloud Native Network",
48
- "project_name": "Cilium",
49
- "file_name": "pull_request_template.md"
50
- },
51
- "content": [
52
- {
53
- "additional_info": "Please ensure your pull request adheres to the following guidelines: - [ ] For first time contributors, read [Submitting a pull request](https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#submitting-a-pull-request) - [ ] All code is covered by unit and/or runtime tests where feasible. - [ ] All commits contain a well written commit description including a title, description and a `Fixes: #XXX` line if the commit addresses a particular GitHub issue. - [ ] If your commit description contains a `Fixes: <commit-id>` tag, then please add the commit author[s] as reviewer[s] to this issue. - [ ] All commits are signed off. See the section [Developer\u2019s Certificate of Origin](https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#dev-coo) - [ ] Provide a title or release-note blurb suitable for the release notes. - [ ] Are you a user of Cilium? Please add yourself to the [Users doc](https://github.com/cilium/cilium/blob/main/USERS.md) - [ ] Thanks for contributing! <!-- Description of change --> Fixes: #issue-number ```release-note <!-- Enter the release note text here if needed or remove this section! --> ```"
54
- }
55
- ]
56
- },
57
- {
58
- "tag": {
59
- "category": "Runtime",
60
- "subcategory": "Cloud Native Network",
61
- "project_name": "Cilium",
62
- "file_name": "README.md"
63
- },
64
- "content": [
65
- {
66
- "heading": "Clock",
67
- "data": "This package provides an interface for time-based operations. It allows mocking time for testing."
68
- },
69
- {
70
- "additional_info": "This package provides an interface for time-based operations. It allows mocking time for testing."
71
- }
72
- ]
73
- },
74
- {
75
- "tag": {
76
- "category": "Runtime",
77
- "subcategory": "Cloud Native Network",
78
- "project_name": "Cilium",
79
- "file_name": "RELEASE.md"
80
- },
81
- "content": [
82
- {
83
- "heading": "Release Process",
84
- "data": "The `yaml` Project is released on an as-needed basis. The process is as follows: 1. An issue is proposing a new release with a changelog since the last release 1. All [OWNERS](OWNERS) must LGTM this release 1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` 1. The release issue is closed 1. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released`"
85
- },
86
- {
87
- "additional_info": "The `yaml` Project is released on an as-needed basis. The process is as follows: 1. An issue is proposing a new release with a changelog since the last release 1. All [OWNERS](OWNERS) must LGTM this release 1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` 1. The release issue is closed 1. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released`"
88
- }
89
- ]
90
- },
91
- {
92
- "tag": {
93
- "category": "Runtime",
94
- "subcategory": "Cloud Native Network",
95
- "project_name": "Cilium",
96
- "file_name": "RELEASING.md"
97
- },
98
- "content": [
99
- {
100
- "heading": "Release Process",
101
- "data": ""
102
- },
103
- {
104
- "heading": "Semantic Convention Generation",
105
- "data": "New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated.\n The `semconv-generate` make target is used for this.\n 1. Checkout a local copy of the [OpenTelemetry Semantic Conventions] to the desired release tag.\n 2. Pull the latest `otel/semconvgen` image: `docker pull otel/semconvgen:latest`\n 3. Run the `make semconv-generate ...` target from this repository.\n For example,\n This should create a new sub-package of [`semconv`](./semconv).\n Ensure things look correct before submitting a pull request to include the addition."
106
- },
107
- {
108
- "heading": "Breaking changes validation",
109
- "data": "You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) to ensure that there are no unwanted changes done in the public API.\n You can check/report problems with `gorelease` [here](https://golang.org/issues/26420)."
110
- },
111
- {
112
- "heading": "Pre-Release",
113
- "data": "First, decide which module sets will be released and update their versions\n in `versions.yaml`. Commit this change to a new branch.\n Update go.mod for submodules to depend on the new release which will happen in the next step.\n 1. Run the `prerelease` make target. It creates a branch\n `prerelease_<module set>_<new tag>` that will contain all release changes.\n ```\n make prerelease MODSET=<module set>\n ```\n 2. Verify the changes.\n ```\n git diff ...prerelease_<module set>_<new tag>\n ```\n This should have changed the version for all modules to be `<new tag>`.\n If these changes look correct, merge them into your pre-release branch:\n ```go\n git merge prerelease_<module set>_<new tag>\n ```\n 3. Update the [Changelog](./CHANGELOG.md).\n - Make sure all relevant changes for this release are included and are in language that non-contributors to the project can understand.\n To verify this, you can look directly at the commits since the `<last tag>`.\n ```\n git --no-pager log --pretty=oneline \"<last tag>..HEAD\"\n ```\n - Move all the `Unreleased` changes into a new section following the title scheme (`[<new tag>] - <date of release>`).\n - Update all the appropriate links at the bottom.\n 4. Push the changes to upstream and create a Pull Request on GitHub.\n Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description."
114
- },
115
- {
116
- "heading": "Tag",
117
- "data": "Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit.\n ***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step!\n Failure to do so will leave things in a broken state. As long as you do not\n change `versions.yaml` between pre-release and this step, things should be fine.\n ***IMPORTANT***: [There is currently no way to remove an incorrectly tagged version of a Go module](https://github.com/golang/go/issues/34189).\n It is critical you make sure the version you push upstream is correct.\n [Failure to do so will lead to minor emergencies and tough to work around](https://github.com/open-telemetry/opentelemetry-go/issues/331).\n 1. For each module set that will be released, run the `add-tags` make target\n using the `<commit-hash>` of the commit on the main branch for the merged Pull Request.\n ```\n make add-tags MODSET=<module set> COMMIT=<commit hash>\n ```\n It should only be necessary to provide an explicit `COMMIT` value if the\n current `HEAD` of your working directory is not the correct commit.\n 2. Push tags to the upstream remote (not your fork: `github.com/open-telemetry/opentelemetry-go.git`).\n Make sure you push all sub-modules as well.\n ```\n git push upstream <new tag>\n git push upstream <submodules-path/new tag>\n ...\n ```"
118
- },
119
- {
120
- "heading": "Release",
121
- "data": "Finally create a Release for the new `<new tag>` on GitHub.\n The release body should include all the release notes from the Changelog for this release."
122
- },
123
- {
124
- "heading": "Verify Examples",
125
- "data": "After releasing verify that examples build outside of the repository.\n The script copies examples into a different directory removes any `replace` declarations in `go.mod` and builds them.\n This ensures they build with the published release, not the local copy."
126
- },
127
- {
128
- "heading": "Post-Release",
129
- "data": ""
130
- },
131
- {
132
- "heading": "Contrib Repository",
133
- "data": "Once verified be sure to [make a release for the `contrib` repository](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md) that uses this release."
134
- },
135
- {
136
- "heading": "Website Documentation",
137
- "data": "Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go].\n Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate.\n [OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions\n [Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/\n [content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go"
138
- },
139
- {
140
- "heading": "Demo Repository",
141
- "data": "Bump the dependencies in the following Go services: - [`accountingservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/accountingservice) - [`checkoutservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/checkoutservice) - [`productcatalogservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/productcatalogservice)"
142
- },
143
- {
144
- "additional_info": "New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated. The `semconv-generate` make target is used for this. 1. Checkout a local copy of the [OpenTelemetry Semantic Conventions] to the desired release tag. 2. Pull the latest `otel/semconvgen` image: `docker pull otel/semconvgen:latest` 3. Run the `make semconv-generate ...` target from this repository. For example, ```sh export TAG=\"v1.21.0\" # Change to the release version you are generating. export OTEL_SEMCONV_REPO=\"/absolute/path/to/opentelemetry/semantic-conventions\" docker pull otel/semconvgen:latest make semconv-generate # Uses the exported TAG and OTEL_SEMCONV_REPO. ``` This should create a new sub-package of [`semconv`](./semconv). Ensure things look correct before submitting a pull request to include the addition. You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) to ensure that there are no unwanted changes done in the public API. You can check/report problems with `gorelease` [here](https://golang.org/issues/26420). First, decide which module sets will be released and update their versions in `versions.yaml`. Commit this change to a new branch. Update go.mod for submodules to depend on the new release which will happen in the next step. 1. Run the `prerelease` make target. It creates a branch `prerelease_<module set>_<new tag>` that will contain all release changes. ``` make prerelease MODSET=<module set> ``` 2. Verify the changes. ``` git diff ...prerelease_<module set>_<new tag> ``` This should have changed the version for all modules to be `<new tag>`. If these changes look correct, merge them into your pre-release branch: ```go git merge prerelease_<module set>_<new tag> ``` 3. Update the [Changelog](./CHANGELOG.md). - Make sure all relevant changes for this release are included and are in language that non-contributors to the project can understand. To verify this, you can look directly at the commits since the `<last tag>`. ``` git --no-pager log --pretty=oneline \"<last tag>..HEAD\" ``` - Move all the `Unreleased` changes into a new section following the title scheme (`[<new tag>] - <date of release>`). - Update all the appropriate links at the bottom. 4. Push the changes to upstream and create a Pull Request on GitHub. Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description. Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit. ***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step! Failure to do so will leave things in a broken state. As long as you do not change `versions.yaml` between pre-release and this step, things should be fine. ***IMPORTANT***: [There is currently no way to remove an incorrectly tagged version of a Go module](https://github.com/golang/go/issues/34189). It is critical you make sure the version you push upstream is correct. [Failure to do so will lead to minor emergencies and tough to work around](https://github.com/open-telemetry/opentelemetry-go/issues/331). 1. For each module set that will be released, run the `add-tags` make target using the `<commit-hash>` of the commit on the main branch for the merged Pull Request. ``` make add-tags MODSET=<module set> COMMIT=<commit hash> ``` It should only be necessary to provide an explicit `COMMIT` value if the current `HEAD` of your working directory is not the correct commit. 2. Push tags to the upstream remote (not your fork: `github.com/open-telemetry/opentelemetry-go.git`). Make sure you push all sub-modules as well. ``` git push upstream <new tag> git push upstream <submodules-path/new tag> ... ``` Finally create a Release for the new `<new tag>` on GitHub. The release body should include all the release notes from the Changelog for this release. After releasing verify that examples build outside of the repository. ``` ./verify_examples.sh ``` The script copies examples into a different directory removes any `replace` declarations in `go.mod` and builds them. This ensures they build with the published release, not the local copy. Once verified be sure to [make a release for the `contrib` repository](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md) that uses this release. Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go]. Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate. [OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions [Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/ [content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go Bump the dependencies in the following Go services: - [`accountingservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/accountingservice) - [`checkoutservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/checkoutservice) - [`productcatalogservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/productcatalogservice)"
145
- }
146
- ]
147
- },
148
- {
149
- "tag": {
150
- "category": "Runtime",
151
- "subcategory": "Cloud Native Network",
152
- "project_name": "Cilium",
153
- "file_name": "SECURITY.md"
154
- },
155
- "content": [
156
- {
157
- "heading": "Security Policy",
158
- "data": ""
159
- },
160
- {
161
- "heading": "Security Announcements",
162
- "data": "Join the [kubernetes-security-announce] group for security and vulnerability announcements.\n You can also subscribe to an RSS feed of the above using [this link][kubernetes-security-announce-rss]."
163
- },
164
- {
165
- "heading": "Reporting a Vulnerability",
166
- "data": "Instructions for reporting a vulnerability can be found on the\n [Kubernetes Security and Disclosure Information] page."
167
- },
168
- {
169
- "heading": "Supported Versions",
170
- "data": "Information about supported Kubernetes versions can be found on the [Kubernetes version and version skew support policy] page on the Kubernetes website. [kubernetes-security-announce]: https://groups.google.com/forum/#!forum/kubernetes-security-announce [kubernetes-security-announce-rss]: https://groups.google.com/forum/feed/kubernetes-security-announce/msgs/rss_v2_0.xml?num=50 [Kubernetes version and version skew support policy]: https://kubernetes.io/docs/setup/release/version-skew-policy/#supported-versions [Kubernetes Security and Disclosure Information]: https://kubernetes.io/docs/reference/issues-security/security/#report-a-vulnerability"
171
- },
172
- {
173
- "additional_info": "Join the [kubernetes-security-announce] group for security and vulnerability announcements. You can also subscribe to an RSS feed of the above using [this link][kubernetes-security-announce-rss]. Instructions for reporting a vulnerability can be found on the [Kubernetes Security and Disclosure Information] page. Information about supported Kubernetes versions can be found on the [Kubernetes version and version skew support policy] page on the Kubernetes website. [kubernetes-security-announce]: https://groups.google.com/forum/#!forum/kubernetes-security-announce [kubernetes-security-announce-rss]: https://groups.google.com/forum/feed/kubernetes-security-announce/msgs/rss_v2_0.xml?num=50 [Kubernetes version and version skew support policy]: https://kubernetes.io/docs/setup/release/version-skew-policy/#supported-versions [Kubernetes Security and Disclosure Information]: https://kubernetes.io/docs/reference/issues-security/security/#report-a-vulnerability"
174
- }
175
- ]
176
- },
177
- {
178
- "tag": {
179
- "category": "Runtime",
180
- "subcategory": "Cloud Native Network",
181
- "project_name": "Cilium",
182
- "file_name": "SHOULDERS.md"
183
- },
184
- "content": [
185
- {
186
- "heading": "Flect Stands on the Shoulders of Giants",
187
- "data": "Flect does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them all together in the best way possible. Without these giants, this project would not be possible. Please make sure to check them out and thank them for all of their hard work. Thank you to the following **GIANTS**: * [github.com/davecgh/go-spew](https://godoc.org/github.com/davecgh/go-spew) * [github.com/pmezard/go-difflib](https://godoc.org/github.com/pmezard/go-difflib) * [github.com/stretchr/objx](https://godoc.org/github.com/stretchr/objx) * [github.com/stretchr/testify](https://godoc.org/github.com/stretchr/testify) * [gopkg.in/check.v1](https://godoc.org/gopkg.in/check.v1) * [gopkg.in/yaml.v3](https://godoc.org/gopkg.in/yaml.v3)"
188
- },
189
- {
190
- "additional_info": "Flect does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them all together in the best way possible. Without these giants, this project would not be possible. Please make sure to check them out and thank them for all of their hard work. Thank you to the following **GIANTS**: * [github.com/davecgh/go-spew](https://godoc.org/github.com/davecgh/go-spew) * [github.com/pmezard/go-difflib](https://godoc.org/github.com/pmezard/go-difflib) * [github.com/stretchr/objx](https://godoc.org/github.com/stretchr/objx) * [github.com/stretchr/testify](https://godoc.org/github.com/stretchr/testify) * [gopkg.in/check.v1](https://godoc.org/gopkg.in/check.v1) * [gopkg.in/yaml.v3](https://godoc.org/gopkg.in/yaml.v3)"
191
- }
192
- ]
193
- },
194
- {
195
- "tag": {
196
- "category": "Runtime",
197
- "subcategory": "Cloud Native Network",
198
- "project_name": "Cilium",
199
- "file_name": "SYNTAX.md"
200
- },
201
- "content": [
202
- {
203
- "heading": "GJSON Path Syntax",
204
- "data": "A GJSON Path is a text string syntax that describes a search pattern for quickly retreiving values from a JSON payload.\n This document is designed to explain the structure of a GJSON Path through examples.\n - [Path structure](#path-structure)\n - [Basic](#basic)\n - [Wildcards](#wildcards)\n - [Escape Character](#escape-character)\n - [Arrays](#arrays)\n - [Queries](#queries)\n - [Dot vs Pipe](#dot-vs-pipe)\n - [Modifiers](#modifiers)\n - [Multipaths](#multipaths)\n - [Literals](#literals)\n The definitive implemenation is [github.com/tidwall/gjson](https://github.com/tidwall/gjson).\n Use the [GJSON Playground](https://gjson.dev) to experiment with the syntax online."
205
- },
206
- {
207
- "heading": "Path structure",
208
- "data": "A GJSON Path is intended to be easily expressed as a series of components seperated by a `.` character.\n Along with `.` character, there are a few more that have special meaning, including `|`, `#`, `@`, `\\`, `*`, `!`, and `?`."
209
- },
210
- {
211
- "heading": "Example",
212
- "data": "Given this JSON\n The following GJSON Paths evaluate to the accompanying values."
213
- },
214
- {
215
- "heading": "Basic",
216
- "data": "In many cases you'll just want to retreive values by object name or array index."
217
- },
218
- {
219
- "heading": "Wildcards",
220
- "data": "A key may contain the special wildcard characters `*` and `?`.\n The `*` will match on any zero+ characters, and `?` matches on any one character."
221
- },
222
- {
223
- "heading": "Escape character",
224
- "data": "Special purpose characters, such as `.`, `*`, and `?` can be escaped with `\\`.\n You'll also need to make sure that the `\\` character is correctly escaped when hardcoding a path in your source code."
225
- },
226
- {
227
- "heading": "Arrays",
228
- "data": "The `#` character allows for digging into JSON Arrays.\n To get the length of an array you'll just use the `#` all by itself."
229
- },
230
- {
231
- "heading": "Queries",
232
- "data": "You can also query an array for the first match by using `#(...)`, or find all matches with `#(...)#`.\n Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` comparison operators,\n and the simple pattern matching `%` (like) and `!%` (not like) operators.\n To query for a non-object value in an array, you can forgo the string to the right of the operator.\n Nested queries are allowed.\n *Please note that prior to v1.3.0, queries used the `#[...]` brackets. This was\n changed in v1.3.0 as to avoid confusion with the new [multipath](#multipaths)\n syntax. For backwards compatibility, `#[...]` will continue to work until the\n next major release.*\n The `~` (tilde) operator will convert a value to a boolean before comparison.\n Supported tilde comparison type are:\n For example, using the following JSON:\n To query for all true-ish or false-ish values:\n The last value which was non-existent is treated as `false`\n To query for null and explicit value existence:"
233
- },
234
- {
235
- "heading": "Dot vs Pipe",
236
- "data": "The `.` is standard separator, but it's also possible to use a `|`.\n In most cases they both end up returning the same results.\n The cases where`|` differs from `.` is when it's used after the `#` for [Arrays](#arrays) and [Queries](#queries).\n Here are some examples\n Let's break down a few of these.\n The path `friends.#(last=\"Murphy\")#` all by itself results in\n The `.first` suffix will process the `first` path on each array element *before* returning the results. Which becomes\n But the `|first` suffix actually processes the `first` path *after* the previous result.\n Since the previous result is an array, not an object, it's not possible to process\n because `first` does not exist.\n Yet, `|0` suffix returns\n Because `0` is the first index of the previous result."
237
- },
238
- {
239
- "heading": "Modifiers",
240
- "data": "A modifier is a path component that performs custom processing on the JSON.\n For example, using the built-in `@reverse` modifier on the above JSON payload will reverse the `children` array:\n There are currently the following built-in modifiers:\n - `@reverse`: Reverse an array or the members of an object.\n - `@ugly`: Remove all whitespace from JSON.\n - `@pretty`: Make the JSON more human readable.\n - `@this`: Returns the current element. It can be used to retrieve the root element.\n - `@valid`: Ensure the json document is valid.\n - `@flatten`: Flattens an array.\n - `@join`: Joins multiple objects into a single object.\n - `@keys`: Returns an array of keys for an object.\n - `@values`: Returns an array of values for an object.\n - `@tostr`: Converts json to a string. Wraps a json string.\n - `@fromstr`: Converts a string from json. Unwraps a json string.\n - `@group`: Groups arrays of objects. See [e4fc67c](https://github.com/tidwall/gjson/commit/e4fc67c92aeebf2089fabc7872f010e340d105db).\n - `@dig`: Search for a value without providing its entire path. See [e8e87f2](https://github.com/tidwall/gjson/commit/e8e87f2a00dc41f3aba5631094e21f59a8cf8cbf)."
241
- },
242
- {
243
- "heading": "Modifier arguments",
244
- "data": "A modifier may accept an optional argument. The argument can be a valid JSON payload or just characters.\n For example, the `@pretty` modifier takes a json object as its argument.\n Which makes the json pretty and orders all of its keys.\n *The full list of `@pretty` options are `sortKeys`, `indent`, `prefix`, and `width`.\n Please see [Pretty Options](https://github.com/tidwall/pretty#customized-output) for more information.*"
245
- },
246
- {
247
- "heading": "Custom modifiers",
248
- "data": "You can also add custom modifiers.\n For example, here we create a modifier which makes the entire JSON payload upper or lower case."
249
- },
250
- {
251
- "heading": "Note: Custom modifiers are not yet available in the Rust version",
252
- "data": ""
253
- },
254
- {
255
- "heading": "Multipaths",
256
- "data": "Starting with v1.3.0, GJSON added the ability to join multiple paths together\n to form new documents. Wrapping comma-separated paths between `[...]` or\n `{...}` will result in a new array or object, respectively.\n For example, using the given multipath:\n Here we selected the first name, age, and the first name for friends with the\n last name \"Murphy\".\n You'll notice that an optional key can be provided, in this case\n \"the_murphys\", to force assign a key to a value. Otherwise, the name of the\n actual field will be used, in this case \"first\". If a name cannot be\n determined, then \"_\" is used.\n This results in"
257
- },
258
- {
259
- "heading": "Literals",
260
- "data": "Starting with v1.12.0, GJSON added support of json literals, which provides a way for constructing static blocks of json. This is can be particularly useful when constructing a new json document using [multipaths](#multipaths).\n A json literal begins with the '!' declaration character.\n For example, using the given multipath:\n Here we selected the first name and age. Then add two new fields, \"company\" and \"employed\".\n This results in"
261
- },
262
- {
263
- "heading": "See issue [#249](https://github.com/tidwall/gjson/issues/249) for additional context on JSON Literals.",
264
- "data": ""
265
- },
266
- {
267
- "additional_info": "A G J S O N P a t h i s a t e x t s t r i n g s y n t a x t h a t d e s c r i b e s a s e a r c h p a t t e r n f o r q u i c k l y r e t r e i v i n g v a l u e s f r o m a J S O N p a y l o a d . T h i s d o c u m e n t i s d e s i g n e d t o e x p l a i n t h e s t r u c t u r e o f a G J S O N P a t h t h r o u g h e x a m p l e s . - [ P a t h s t r u c t u r e ] ( # p a t h - s t r u c t u r e ) - [ B a s i c ] ( # b a s i c ) - [ W i l d c a r d s ] ( # w i l d c a r d s ) - [ E s c a p e C h a r a c t e r ] ( # e s c a p e - c h a r a c t e r ) - [ A r r a y s ] ( # a r r a y s ) - [ Q u e r i e s ] ( # q u e r i e s ) - [ D o t v s P i p e ] ( # d o t - v s - p i p e ) - [ M o d i f i e r s ] ( # m o d i f i e r s ) - [ M u l t i p a t h s ] ( # m u l t i p a t h s ) - [ L i t e r a l s ] ( # l i t e r a l s ) T h e d e f i n i t i v e i m p l e m e n a t i o n i s [ g i t h u b . c o m / t i d w a l l / g j s o n ] ( h t t p s : / / g i t h u b . c o m / t i d w a l l / g j s o n ) . U s e t h e [ G J S O N P l a y g r o u n d ] ( h t t p s : / / g j s o n . d e v ) t o e x p e r i m e n t w i t h t h e s y n t a x o n l i n e . A G J S O N P a t h i s i n t e n d e d t o b e e a s i l y e x p r e s s e d a s a s e r i e s o f c o m p o n e n t s s e p e r a t e d b y a ` . ` c h a r a c t e r . A l o n g w i t h ` . ` c h a r a c t e r , t h e r e a r e a f e w m o r e t h a t h a v e s p e c i a l m e a n i n g , i n c l u d i n g ` | ` , ` # ` , ` @ ` , ` \\ ` , ` * ` , ` ! ` , a n d ` ? ` . G i v e n t h i s J S O N ` ` ` j s o n { \" n a m e \" : { \" f i r s t \" : \" T o m \" , \" l a s t \" : \" A n d e r s o n \" } , \" a g e \" : 3 7 , \" c h i l d r e n \" : [ \" S a r a \" , \" A l e x \" , \" J a c k \" ] , \" f a v . m o v i e \" : \" D e e r H u n t e r \" , \" f r i e n d s \" : [ { \" f i r s t \" : \" D a l e \" , \" l a s t \" : \" M u r p h y \" , \" a g e \" : 4 4 , \" n e t s \" : [ \" i g \" , \" f b \" , \" t w \" ] } , { \" f i r s t \" : \" R o g e r \" , \" l a s t \" : \" C r a i g \" , \" a g e \" : 6 8 , \" n e t s \" : [ \" f b \" , \" t w \" ] } , { \" f i r s t \" : \" J a n e \" , \" l a s t \" : \" M u r p h y \" , \" a g e \" : 4 7 , \" n e t s \" : [ \" i g \" , \" t w \" ] } ] } ` ` ` T h e f o l l o w i n g G J S O N P a t h s e v a l u a t e t o t h e a c c o m p a n y i n g v a l u e s . I n m a n y c a s e s y o u ' l l j u s t w a n t t o r e t r e i v e v a l u e s b y o b j e c t n a m e o r a r r a y i n d e x . ` ` ` g o n a m e . l a s t \" A n d e r s o n \" n a m e . f i r s t \" T o m \" a g e 3 7 c h i l d r e n [ \" S a r a \" , \" A l e x \" , \" J a c k \" ] c h i l d r e n . 0 \" S a r a \" c h i l d r e n . 1 \" A l e x \" f r i e n d s . 1 { \" f i r s t \" : \" R o g e r \" , \" l a s t \" : \" C r a i g \" , \" a g e \" : 6 8 } f r i e n d s . 1 . f i r s t \" R o g e r \" ` ` ` A k e y m a y c o n t a i n t h e s p e c i a l w i l d c a r d c h a r a c t e r s ` * ` a n d ` ? ` . T h e ` * ` w i l l m a t c h o n a n y z e r o + c h a r a c t e r s , a n d ` ? ` m a t c h e s o n a n y o n e c h a r a c t e r . ` ` ` g o c h i l d * . 2 \" J a c k \" c ? i l d r e n . 0 \" S a r a \" ` ` ` S p e c i a l p u r p o s e c h a r a c t e r s , s u c h a s ` . ` , ` * ` , a n d ` ? ` c a n b e e s c a p e d w i t h ` \\ ` . ` ` ` g o f a v \\ . m o v i e \" D e e r H u n t e r \" ` ` ` Y o u ' l l a l s o n e e d t o m a k e s u r e t h a t t h e ` \\ ` c h a r a c t e r i s c o r r e c t l y e s c a p e d w h e n h a r d c o d i n g a p a t h i n y o u r s o u r c e c o d e . ` ` ` g o / / G o v a l : = g j s o n . G e t ( j s o n , \" f a v \\ \\ . m o v i e \" ) / / m u s t e s c a p e t h e s l a s h v a l : = g j s o n . G e t ( j s o n , ` f a v \\ . m o v i e ` ) / / n o n e e d t o e s c a p e t h e s l a s h ` ` ` ` ` ` r u s t / / R u s t l e t v a l = g j s o n : : g e t ( j s o n , \" f a v \\ \\ . m o v i e \" ) / / m u s t e s c a p e t h e s l a s h l e t v a l = g j s o n : : g e t ( j s o n , r # \" f a v \\ . m o v i e \" # ) / / n o n e e d t o e s c a p e t h e s l a s h ` ` ` T h e ` # ` c h a r a c t e r a l l o w s f o r d i g g i n g i n t o J S O N A r r a y s . T o g e t t h e l e n g t h o f a n a r r a y y o u ' l l j u s t u s e t h e ` # ` a l l b y i t s e l f . ` ` ` g o f r i e n d s . # 3 f r i e n d s . # . a g e [ 4 4 , 6 8 , 4 7 ] ` ` ` Y o u c a n a l s o q u e r y a n a r r a y f o r t h e f i r s t m a t c h b y u s i n g ` # ( . . . ) ` , o r f i n d a l l m a t c h e s w i t h ` # ( . . . ) # ` . Q u e r i e s s u p p o r t t h e ` = = ` , ` ! = ` , ` < ` , ` < = ` , ` > ` , ` > = ` c o m p a r i s o n o p e r a t o r s , a n d t h e s i m p l e p a t t e r n m a t c h i n g ` % ` ( l i k e ) a n d ` ! % ` ( n o t l i k e ) o p e r a t o r s . ` ` ` g o f r i e n d s . # ( l a s t = = \" M u r p h y \" ) . f i r s t \" D a l e \" f r i e n d s . # ( l a s t = = \" M u r p h y \" ) # . f i r s t [ \" D a l e \" , \" J a n e \" ] f r i e n d s . # ( a g e > 4 5 ) # . l a s t [ \" C r a i g \" , \" M u r p h y \" ] f r i e n d s . # ( f i r s t % \" D * \" ) . l a s t \" M u r p h y \" f r i e n d s . # ( f i r s t ! % \" D * \" ) . l a s t \" C r a i g \" ` ` ` T o q u e r y f o r a n o n - o b j e c t v a l u e i n a n a r r a y , y o u c a n f o r g o t h e s t r i n g t o t h e r i g h t o f t h e o p e r a t o r . ` ` ` g o c h i l d r e n . # ( ! % \" * a * \" ) \" A l e x \" c h i l d r e n . # ( % \" * a * \" ) # [ \" S a r a \" , \" J a c k \" ] ` ` ` N e s t e d q u e r i e s a r e a l l o w e d . ` ` ` g o f r i e n d s . # ( n e t s . # ( = = \" f b \" ) ) # . f i r s t > > [ \" D a l e \" , \" R o g e r \" ] ` ` ` * P l e a s e n o t e t h a t p r i o r t o v 1 . 3 . 0 , q u e r i e s u s e d t h e ` # [ . . . ] ` b r a c k e t s . T h i s w a s c h a n g e d i n v 1 . 3 . 0 a s t o a v o i d c o n f u s i o n w i t h t h e n e w [ m u l t i p a t h ] ( # m u l t i p a t h s ) s y n t a x . F o r b a c k w a r d s c o m p a t i b i l i t y , ` # [ . . . ] ` w i l l c o n t i n u e t o w o r k u n t i l t h e n e x t m a j o r r e l e a s e . * T h e ` ~ ` ( t i l d e ) o p e r a t o r w i l l c o n v e r t a v a l u e t o a b o o l e a n b e f o r e c o m p a r i s o n . S u p p o r t e d t i l d e c o m p a r i s o n t y p e a r e : ` ` ` ~ t r u e C o n v e r t s t r u e - i s h v a l u e s t o t r u e ~ f a l s e C o n v e r t s f a l s e - i s h a n d n o n - e x i s t e n t v a l u e s t o t r u e ~ n u l l C o n v e r t s n u l l a n d n o n - e x i s t e n t v a l u e s t o t r u e ~ * C o n v e r t s a n y e x i s t i n g v a l u e t o t r u e ` ` ` F o r e x a m p l e , u s i n g t h e f o l l o w i n g J S O N : ` ` ` j s o n { \" v a l s \" : [ { \" a \" : 1 , \" b \" : \" d a t a \" } , { \" a \" : 2 , \" b \" : t r u e } , { \" a \" : 3 , \" b \" : f a l s e } , { \" a \" : 4 , \" b \" : \" 0 \" } , { \" a \" : 5 , \" b \" : 0 } , { \" a \" : 6 , \" b \" : \" 1 \" } , { \" a \" : 7 , \" b \" : 1 } , { \" a \" : 8 , \" b \" : \" t r u e \" } , { \" a \" : 9 , \" b \" : f a l s e } , { \" a \" : 1 0 , \" b \" : n u l l } , { \" a \" : 1 1 } ] } ` ` ` T o q u e r y f o r a l l t r u e - i s h o r f a l s e - i s h v a l u e s : ` ` ` v a l s . # ( b = = ~ t r u e ) # . a > > [ 2 , 6 , 7 , 8 ] v a l s . # ( b = = ~ f a l s e ) # . a > > [ 3 , 4 , 5 , 9 , 1 0 , 1 1 ] ` ` ` T h e l a s t v a l u e w h i c h w a s n o n - e x i s t e n t i s t r e a t e d a s ` f a l s e ` T o q u e r y f o r n u l l a n d e x p l i c i t v a l u e e x i s t e n c e : ` ` ` v a l s . # ( b = = ~ n u l l ) # . a > > [ 1 0 , 1 1 ] v a l s . # ( b = = ~ * ) # . a > > [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 ] v a l s . # ( b ! = ~ * ) # . a > > [ 1 1 ] ` ` ` T h e ` . ` i s s t a n d a r d s e p a r a t o r , b u t i t ' s a l s o p o s s i b l e t o u s e a ` | ` . I n m o s t c a s e s t h e y b o t h e n d u p r e t u r n i n g t h e s a m e r e s u l t s . T h e c a s e s w h e r e ` | ` d i f f e r s f r o m ` . ` i s w h e n i t ' s u s e d a f t e r t h e ` # ` f o r [ A r r a y s ] ( # a r r a y s ) a n d [ Q u e r i e s ] ( # q u e r i e s ) . H e r e a r e s o m e e x a m p l e s ` ` ` g o f r i e n d s . 0 . f i r s t \" D a l e \" f r i e n d s | 0 . f i r s t \" D a l e \" f r i e n d s . 0 | f i r s t \" D a l e \" f r i e n d s | 0 | f i r s t \" D a l e \" f r i e n d s | # 3 f r i e n d s . # 3 f r i e n d s . # ( l a s t = \" M u r p h y \" ) # [ { \" f i r s t \" : \" D a l e \" , \" l a s t \" : \" M u r p h y \" , \" a g e \" : 4 4 } , { \" f i r s t \" : \" J a n e \" , \" l a s t \" : \" M u r p h y \" , \" a g e \" : 4 7 } ] f r i e n d s . # ( l a s t = \" M u r p h y \" ) # . f i r s t [ \" D a l e \" , \" J a n e \" ] f r i e n d s . # ( l a s t = \" M u r p h y \" ) # | f i r s t < n o n - e x i s t e n t > f r i e n d s . # ( l a s t = \" M u r p h y \" ) # . 0 [ ] f r i e n d s . # ( l a s t = \" M u r p h y \" ) # | 0 { \" f i r s t \" : \" D a l e \" , \" l a s t \" : \" M u r p h y \" , \" a g e \" : 4 4 } f r i e n d s . # ( l a s t = \" M u r p h y \" ) # . # [ ] f r i e n d s . # ( l a s t = \" M u r p h y \" ) # | # 2 ` ` ` L e t ' s b r e a k d o w n a f e w o f t h e s e . T h e p a t h ` f r i e n d s . # ( l a s t = \" M u r p h y \" ) # ` a l l b y i t s e l f r e s u l t s i n ` ` ` j s o n [ { \" f i r s t \" : \" D a l e \" , \" l a s t \" : \" M u r p h y \" , \" a g e \" : 4 4 } , { \" f i r s t \" : \" J a n e \" , \" l a s t \" : \" M u r p h y \" , \" a g e \" : 4 7 } ] ` ` ` T h e ` . f i r s t ` s u f f i x w i l l p r o c e s s t h e ` f i r s t ` p a t h o n e a c h a r r a y e l e m e n t * b e f o r e * r e t u r n i n g t h e r e s u l t s . W h i c h b e c o m e s ` ` ` j s o n [ \" D a l e \" , \" J a n e \" ] ` ` ` B u t t h e ` | f i r s t ` s u f f i x a c t u a l l y p r o c e s s e s t h e ` f i r s t ` p a t h * a f t e r * t h e p r e v i o u s r e s u l t . S i n c e t h e p r e v i o u s r e s u l t i s a n a r r a y , n o t a n o b j e c t , i t ' s n o t p o s s i b l e t o p r o c e s s b e c a u s e ` f i r s t ` d o e s n o t e x i s t . Y e t , ` | 0 ` s u f f i x r e t u r n s ` ` ` j s o n { \" f i r s t \" : \" D a l e \" , \" l a s t \" : \" M u r p h y \" , \" a g e \" : 4 4 } ` ` ` B e c a u s e ` 0 ` i s t h e f i r s t i n d e x o f t h e p r e v i o u s r e s u l t . A m o d i f i e r i s a p a t h c o m p o n e n t t h a t p e r f o r m s c u s t o m p r o c e s s i n g o n t h e J S O N . F o r e x a m p l e , u s i n g t h e b u i l t - i n ` @ r e v e r s e ` m o d i f i e r o n t h e a b o v e J S O N p a y l o a d w i l l r e v e r s e t h e ` c h i l d r e n ` a r r a y : ` ` ` g o c h i l d r e n . @ r e v e r s e [ \" J a c k \" , \" A l e x \" , \" S a r a \" ] c h i l d r e n . @ r e v e r s e . 0 \" J a c k \" ` ` ` T h e r e a r e c u r r e n t l y t h e f o l l o w i n g b u i l t - i n m o d i f i e r s : - ` @ r e v e r s e ` : R e v e r s e a n a r r a y o r t h e m e m b e r s o f a n o b j e c t . - ` @ u g l y ` : R e m o v e a l l w h i t e s p a c e f r o m J S O N . - ` @ p r e t t y ` : M a k e t h e J S O N m o r e h u m a n r e a d a b l e . - ` @ t h i s ` : R e t u r n s t h e c u r r e n t e l e m e n t . I t c a n b e u s e d t o r e t r i e v e t h e r o o t e l e m e n t . - ` @ v a l i d ` : E n s u r e t h e j s o n d o c u m e n t i s v a l i d . - ` @ f l a t t e n ` : F l a t t e n s a n a r r a y . - ` @ j o i n ` : J o i n s m u l t i p l e o b j e c t s i n t o a s i n g l e o b j e c t . - ` @ k e y s ` : R e t u r n s a n a r r a y o f k e y s f o r a n o b j e c t . - ` @ v a l u e s ` : R e t u r n s a n a r r a y o f v a l u e s f o r a n o b j e c t . - ` @ t o s t r ` : C o n v e r t s j s o n t o a s t r i n g . W r a p s a j s o n s t r i n g . - ` @ f r o m s t r ` : C o n v e r t s a s t r i n g f r o m j s o n . U n w r a p s a j s o n s t r i n g . - ` @ g r o u p ` : G r o u p s a r r a y s o f o b j e c t s . S e e [ e 4 f c 6 7 c ] ( h t t p s : / / g i t h u b . c o m / t i d w a l l / g j s o n / c o m m i t / e 4 f c 6 7 c 9 2 a e e b f 2 0 8 9 f a b c 7 8 7 2 f 0 1 0 e 3 4 0 d 1 0 5 d b ) . - ` @ d i g ` : S e a r c h f o r a v a l u e w i t h o u t p r o v i d i n g i t s e n t i r e p a t h . S e e [ e 8 e 8 7 f 2 ] ( h t t p s : / / g i t h u b . c o m / t i d w a l l / g j s o n / c o m m i t / e 8 e 8 7 f 2 a 0 0 d c 4 1 f 3 a b a 5 6 3 1 0 9 4 e 2 1 f 5 9 a 8 c f 8 c b f ) . A m o d i f i e r m a y a c c e p t a n o p t i o n a l a r g u m e n t . T h e a r g u m e n t c a n b e a v a l i d J S O N p a y l o a d o r j u s t c h a r a c t e r s . F o r e x a m p l e , t h e ` @ p r e t t y ` m o d i f i e r t a k e s a j s o n o b j e c t a s i t s a r g u m e n t . ` ` ` @ p r e t t y : { \" s o r t K e y s \" : t r u e } ` ` ` W h i c h m a k e s t h e j s o n p r e t t y a n d o r d e r s a l l o f i t s k e y s . ` ` ` j s o n { \" a g e \" : 3 7 , \" c h i l d r e n \" : [ \" S a r a \" , \" A l e x \" , \" J a c k \" ] , \" f a v . m o v i e \" : \" D e e r H u n t e r \" , \" f r i e n d s \" : [ { \" a g e \" : 4 4 , \" f i r s t \" : \" D a l e \" , \" l a s t \" : \" M u r p h y \" } , { \" a g e \" : 6 8 , \" f i r s t \" : \" R o g e r \" , \" l a s t \" : \" C r a i g \" } , { \" a g e \" : 4 7 , \" f i r s t \" : \" J a n e \" , \" l a s t \" : \" M u r p h y \" } ] , \" n a m e \" : { \" f i r s t \" : \" T o m \" , \" l a s t \" : \" A n d e r s o n \" } } ` ` ` * T h e f u l l l i s t o f ` @ p r e t t y ` o p t i o n s a r e ` s o r t K e y s ` , ` i n d e n t ` , ` p r e f i x ` , a n d ` w i d t h ` . P l e a s e s e e [ P r e t t y O p t i o n s ] ( h t t p s : / / g i t h u b . c o m / t i d w a l l / p r e t t y # c u s t o m i z e d - o u t p u t ) f o r m o r e i n f o r m a t i o n . * Y o u c a n a l s o a d d c u s t o m m o d i f i e r s . F o r e x a m p l e , h e r e w e c r e a t e a m o d i f i e r w h i c h m a k e s t h e e n t i r e J S O N p a y l o a d u p p e r o r l o w e r c a s e . ` ` ` g o g j s o n . A d d M o d i f i e r ( \" c a s e \" , f u n c ( j s o n , a r g s t r i n g ) s t r i n g { i f a r g = = \" u p p e r \" { r e t u r n s t r i n g s . T o U p p e r ( j s o n ) } i f a r g = = \" l o w e r \" { r e t u r n s t r i n g s . T o L o w e r ( j s o n ) } r e t u r n j s o n } ) \" c h i l d r e n . @ c a s e : u p p e r \" [ \" S A R A \" , \" A L E X \" , \" J A C K \" ] \" c h i l d r e n . @ c a s e : l o w e r . @ r e v e r s e \" [ \" j a c k \" , \" a l e x \" , \" s a r a \" ] ` ` ` S t a r t i n g w i t h v 1 . 3 . 0 , G J S O N a d d e d t h e a b i l i t y t o j o i n m u l t i p l e p a t h s t o g e t h e r t o f o r m n e w d o c u m e n t s . W r a p p i n g c o m m a - s e p a r a t e d p a t h s b e t w e e n ` [ . . . ] ` o r ` { . . . } ` w i l l r e s u l t i n a n e w a r r a y o r o b j e c t , r e s p e c t i v e l y . F o r e x a m p l e , u s i n g t h e g i v e n m u l t i p a t h : ` ` ` { n a m e . f i r s t , a g e , \" t h e _ m u r p h y s \" : f r i e n d s . # ( l a s t = \" M u r p h y \" ) # . f i r s t } ` ` ` H e r e w e s e l e c t e d t h e f i r s t n a m e , a g e , a n d t h e f i r s t n a m e f o r f r i e n d s w i t h t h e l a s t n a m e \" M u r p h y \" . Y o u ' l l n o t i c e t h a t a n o p t i o n a l k e y c a n b e p r o v i d e d , i n t h i s c a s e \" t h e _ m u r p h y s \" , t o f o r c e a s s i g n a k e y t o a v a l u e . O t h e r w i s e , t h e n a m e o f t h e a c t u a l f i e l d w i l l b e u s e d , i n t h i s c a s e \" f i r s t \" . I f a n a m e c a n n o t b e d e t e r m i n e d , t h e n \" _ \" i s u s e d . T h i s r e s u l t s i n ` ` ` j s o n { \" f i r s t \" : \" T o m \" , \" a g e \" : 3 7 , \" t h e _ m u r p h y s \" : [ \" D a l e \" , \" J a n e \" ] } ` ` ` S t a r t i n g w i t h v 1 . 1 2 . 0 , G J S O N a d d e d s u p p o r t o f j s o n l i t e r a l s , w h i c h p r o v i d e s a w a y f o r c o n s t r u c t i n g s t a t i c b l o c k s o f j s o n . T h i s i s c a n b e p a r t i c u l a r l y u s e f u l w h e n c o n s t r u c t i n g a n e w j s o n d o c u m e n t u s i n g [ m u l t i p a t h s ] ( # m u l t i p a t h s ) . A j s o n l i t e r a l b e g i n s w i t h t h e ' ! ' d e c l a r a t i o n c h a r a c t e r . F o r e x a m p l e , u s i n g t h e g i v e n m u l t i p a t h : ` ` ` { n a m e . f i r s t , a g e , \" c o m p a n y \" : ! \" H a p p y s o f t \" , \" e m p l o y e d \" : ! t r u e } ` ` ` H e r e w e s e l e c t e d t h e f i r s t n a m e a n d a g e . T h e n a d d t w o n e w f i e l d s , \" c o m p a n y \" a n d \" e m p l o y e d \" . T h i s r e s u l t s i n ` ` ` j s o n { \" f i r s t \" : \" T o m \" , \" a g e \" : 3 7 , \" c o m p a n y \" : \" H a p p y s o f t \" , \" e m p l o y e d \" : t r u e } ` ` `"
268
- }
269
- ]
270
- }
271
- ]