|
2 | 2 |
|
3 | 3 | public static class HelpContent
|
4 | 4 | {
|
5 |
| - public const string SchemaEvaluate = |
6 |
| - """ |
7 |
| - ## Evaluating a schema |
8 |
| -
|
9 |
| - The schema to be used for evaluation will go in the editor on the left. |
10 |
| -
|
11 |
| - The JSON data to evaluate (the "instance") will go in the editor on the right. |
12 |
| -
|
13 |
| - Ensure the options are as desired and click "Run". |
14 |
| -
|
15 |
| - All of the `json-everything` vocabulary extensions are also available. Use these URIs for your |
16 |
| - `$schema` value to enable them: |
17 |
| -
|
18 |
| - - [Data](https://docs.json-everything.net/schema/vocabs/data-2023/) - `https://json-everything.net/meta/data-2023` |
19 |
| - - [OpenAPI v3.1](https://docs.json-everything.net/schema/vocabs/openapi/) - `https://spec.openapis.org/oas/3.1/meta/base` |
20 |
| - - [ArrayExt](https://docs.json-everything.net/schema/vocabs/array-ext/) - `https://json-everything.net/meta/vocab/array-ext` |
21 |
| -
|
22 |
| - \* _The Data 2022 dialect is also still supported._ |
23 |
| - """; |
24 |
| - |
25 |
| - public const string SchemaGenerateSchema = |
26 |
| - """ |
27 |
| - ## Generating a Schema |
28 |
| -
|
29 |
| - Enter your C# classes in the editor on the left. The playground will generate a schema for |
30 |
| - the first type it encounters, so supporting classes need to be placed at the bottom of the code. |
31 |
| -
|
32 |
| - There is no need to add a namespace, however you may need to add `using` statements depending |
33 |
| - on the types you expect to use. A few are included by default: |
34 |
| -
|
35 |
| - - `System` |
36 |
| - - `System.Collections.Generic` |
37 |
| - - `System.Text.Json` |
38 |
| - - `System.Text.Json.Nodes` |
39 |
| - - `System.Text.Json.Serialization` |
40 |
| - - `Json.Schema` |
41 |
| - - `Json.Schema.Generation` |
42 |
| -
|
43 |
| - When you're done, click "Run". |
44 |
| -
|
45 |
| - If the C# is valid, you will receive a JSON Schema in the results editor. Otherwise, you will |
46 |
| - receive an error that says "compilation error." |
47 |
| -
|
48 |
| - ***NOTE** The playground will output the compilation error to the console, including the |
49 |
| - serialized details. I haven't yet figured out how to interpret these details to provide any |
50 |
| - insight into what in particular is wrong. If you know, please feel free to raise an issue.* |
51 |
| -
|
52 |
| - ## AOT Support |
53 |
| -
|
54 |
| - _JsonSchem.Net.Generation_ supports AOT in that it is properly marked as requiring reflection. |
55 |
| - However, due to that requirement, it likely will not work as expected in an AOT context. |
56 |
| - """; |
57 |
| - |
58 |
| - public const string SchemaGenerateData = |
59 |
| - """ |
60 |
| - ## Generating Random Data |
61 |
| -
|
62 |
| - Enter the schema for which you like to generate data into the left editor. |
63 |
| -
|
64 |
| - Click "Run", and the resulting data will appear in the right editor. |
65 |
| -
|
66 |
| - There are a few limitations on which keywords are supported for data generation. Please |
67 |
| - read the [documentation](https://docs.json-everything.net/schema/datagen/schema-datagen/) to find out |
68 |
| - what's supported. |
69 |
| - """; |
70 |
| - |
71 |
| - public const string SchemaVersion = |
72 |
| - """ |
73 |
| - Allows selection of which JSON Schema version to use. This option serves as a fallback for when |
74 |
| - the schema itself does not include a `$schema` keyword. |
75 |
| - """; |
76 |
| - |
77 |
| - public const string SchemaOutputFormat = |
78 |
| - """ |
79 |
| - The output format is described in the JSON Schema specification. By default, JsonSchema.Net |
80 |
| - uses the formats described by the next version of the specification. More information can be |
81 |
| - found in [this blog post](https://json-schema.org/blog/posts/fixing-json-schema-output). |
82 |
| -
|
83 |
| - The available formats are: |
84 |
| -
|
85 |
| - - Flag - just a true/false indication of whether validation succeeded. |
86 |
| - - List - All validation results are organized into a top-level list. |
87 |
| - - Hierarchical - Validation results are organized into a hierarchy that mimics the schema structure. |
88 |
| -
|
89 |
| - If you prefer, you can choose the equivalent 2020-12 output formats using the **Output Structure** |
90 |
| - option below. See the [evaluation results](https://docs.json-everything.net/schema/basics/#schema-results) |
91 |
| - section of the docs for more information on what the library offers. |
92 |
| - """; |
93 |
| - |
94 |
| - public const string SchemaDroppedAnnotations = |
95 |
| - """ |
96 |
| - Per the JSON Schema specification, subschemas which fail evaluation must drop their annotations. |
97 |
| - This option will include these annotations under a `droppedAnnotations` property when using the |
98 |
| - "Draft-Next" output. This can be useful for debugging. |
99 |
| - """; |
100 |
| - |
101 |
| - public const string SchemaUnknownKeywordsAnnotation = |
102 |
| - """ |
103 |
| - (experimental) Adds an annotation to the output that contains a list of schema keywords that were |
104 |
| - unrecognized by its meta-schema. See |
105 |
| - [this JSON Schema discussion](https://github.com/orgs/json-schema-org/discussions/512) for more |
106 |
| - information to provide feedback on the potential feature. |
107 |
| - """; |
108 |
| - |
109 |
| - public const string SchemaValidateFormat = |
110 |
| - """ |
111 |
| - Allows you to specify whether the `format` keyword should be asserted. Typically this is an |
112 |
| - annotation-only keyword, meaning that it will appear in the output, but it will not be validated. |
113 |
| - """; |
114 |
| - |
115 |
| - public const string PathExtraWhitespace = |
116 |
| - """ |
117 |
| - JSON Path only permits whitespace in specific locations. This option will allow whitespace everywhere. |
118 |
| - """; |
119 |
| - |
120 |
| - public const string PathJsonLiterals = |
121 |
| - """ |
122 |
| - JSON Path doesn't allow composite JSON literals such as arrays and objects in filter expressions. |
123 |
| - This option will allow these kinds of values. For example, |
124 |
| -
|
125 |
| - ``` |
126 |
| - $[[email protected]=={"key":"value"}] |
127 |
| - ``` |
128 |
| -
|
129 |
| - to find all elements where `@.foo` is the JSON object `{"key":"value"}`. |
130 |
| -
|
131 |
| - Composite JSON literals are only valid for equality checks, not comparisons. |
132 |
| -
|
133 |
| - JSON literals MUST use double quotes `"`, not single quotes `'`. |
134 |
| - """; |
135 |
| - |
136 |
| - public const string PathJsonInOperator = |
137 |
| - """ |
138 |
| - JSON Path does not support the `in` operator in expressions. For example, |
139 |
| -
|
140 |
| - ``` |
141 |
| - $[[email protected] in ["a","b","c"]] |
142 |
| - ``` |
143 |
| -
|
144 |
| - to find all elements where `@.foo` is either `"a"`, `"b"`, or `"c"`. Or |
145 |
| -
|
146 |
| - ``` |
147 |
| - $[?!(5 in @.bar)] |
148 |
| - ``` |
149 |
| -
|
150 |
| - to find all elements where `@.bar` does not contain a `5`. |
151 |
| - """; |
152 |
| - |
153 |
| - public const string PathMathOperators = |
154 |
| - """ |
155 |
| - JSON Path only defines equality and comparison operators. This enables other math operators. |
156 |
| - Unless otherwise specified, these are only valid for numeric values. If an incompatible value is |
157 |
| - encountered during evaluation, the node will not be selected. |
158 |
| -
|
159 |
| - - `+` - addition (numbers) & concatenation (strings) |
160 |
| - - `-` - subtraction |
161 |
| - - `*` - multiplication |
162 |
| - - `/` - division |
163 |
| - """; |
164 |
| - |
165 |
| - public const string PathRelativeStart = |
166 |
| - """ |
167 |
| - JSON Path requires paths to start with `$`. However, during development of the specification, |
168 |
| - a use case was raised for allowing paths to start with `@`. This option allows such paths. |
169 |
| - For example, `@.foo` would be valid as a complete path. |
170 |
| - """; |
171 |
| - |
172 |
| - public const string PathEvaluate = |
173 |
| - """ |
174 |
| - By default, _JsonPath.Net_ operates per the specification. The above options allow |
175 |
| - the library to deviate from the specification in useful ways. |
176 |
| - """; |
177 |
| - |
178 |
| - public const string JsonEEvaluate = |
179 |
| - """ |
180 |
| - JSON-e evaluates templates with an optional context. |
181 |
| -
|
182 |
| - The template may be any JSON value, and the context must be an object. The output will be displayed below. |
183 |
| -
|
184 |
| - Please read the [documentation](https://docs.json-everything.net/json-e/basics/) for more information. |
185 |
| -
|
186 |
| - It may also be beneficial to compare your results with the [original JavaScript playground](https://json-e.js.org/playground.html). |
187 |
| -
|
188 |
| - This playground also supports YAML input. If either of the inputs are YAML, the output will also be YAML. |
189 |
| - """; |
190 |
| - |
191 |
| - public const string PatchApply = |
192 |
| - """ |
193 |
| - To apply a patch, enter the patch in the left editor and the data to patch in the right editor. |
194 |
| - """; |
195 |
| - |
196 |
| - public const string PatchGenerate = |
197 |
| - """ |
198 |
| - To generate a patch, enter the starting data in the left editor and the target data in the right editor. |
199 |
| -
|
200 |
| - Patch generation follows an iterative strategy, preferring multiple small changes. This may result in |
201 |
| - larger patches than expected. |
| 5 | + public const string Intro = |
| 6 | + """ |
| 7 | + Welcome to _Learn `json-everything`_: your personal training grounds for learning how to |
| 8 | + use the `json-everything` libraries to their full potential! |
| 9 | + |
| 10 | + Inside, you'll find a collection of lessons, each of which highlight a specific feature |
| 11 | + provided by one of the libraries. For each lesson, you'll be given some background information, |
| 12 | + possibly some links to various documentation, and a coding challenge along with some test |
| 13 | + cases. To move on to the next lesson, your code will need to make all test cases pass. |
| 14 | + |
| 15 | + Want to skip ahead and work on a particular lesson? No problem: simply select the lesson |
| 16 | + you'd like to work on from the pane on the left. The navigation buttons will activate as |
| 17 | + needed to provide a guided experience, but you're free to work on any lessons you want at |
| 18 | + any time. |
| 19 | + |
| 20 | + To assist you on your journey, the site will keep track of the lessons you've completed |
| 21 | + as well as your solutions to them so that you can take a break and come back at any time |
| 22 | + either to continue learning or to review the work you've done. |
| 23 | + |
| 24 | + **This site is 100% client-side. All operations are performed in your browser. There |
| 25 | + is no server to send any of your data to.** |
| 26 | + |
| 27 | + --- |
| 28 | + |
| 29 | + These lessons are about learning the libraries, not the technologies they implement. |
| 30 | + For information on the technologies themselves, please see the following sites: |
| 31 | + |
| 32 | + ||| |
| 33 | + |:-|:-| |
| 34 | + |JSON Schema|[https://json-schema-org.github.io/tour/](https://json-schema-org.github.io/tour/)| |
| 35 | + |JSON-e|[https://json-e.js.org/](https://json-e.js.org/)| |
| 36 | + |JSON Logic|[https://jsonlogic.com/](https://jsonlogic.com/)| |
| 37 | + |JSON Patch|[https://jsonpatch.com/](https://jsonpatch.com/)| |
202 | 38 | """;
|
203 | 39 | }
|
0 commit comments