@typespec/json-schema 0.54.0-dev.2 → 0.54.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -57
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,9 +112,9 @@ Set the base URI for any schemas emitted from types within this namespace.
|
|
|
112
112
|
|
|
113
113
|
##### Parameters
|
|
114
114
|
|
|
115
|
-
| Name | Type
|
|
116
|
-
| ------- |
|
|
117
|
-
| baseUri | `valueof
|
|
115
|
+
| Name | Type | Description |
|
|
116
|
+
| ------- | ---------------- | ------------------------------------------------------------------------ |
|
|
117
|
+
| baseUri | `valueof string` | the base URI. Schema IDs inside this namespace are relative to this URI. |
|
|
118
118
|
|
|
119
119
|
#### `@contains`
|
|
120
120
|
|
|
@@ -127,13 +127,13 @@ Use `@minContains` and `@maxContains` to customize how many instances to expect.
|
|
|
127
127
|
|
|
128
128
|
##### Target
|
|
129
129
|
|
|
130
|
-
`
|
|
130
|
+
`unknown[] | ModelProperty`
|
|
131
131
|
|
|
132
132
|
##### Parameters
|
|
133
133
|
|
|
134
|
-
| Name | Type
|
|
135
|
-
| ----- |
|
|
136
|
-
| value | `
|
|
134
|
+
| Name | Type | Description |
|
|
135
|
+
| ----- | --------- | -------------------------------- |
|
|
136
|
+
| value | `unknown` | The type the array must contain. |
|
|
137
137
|
|
|
138
138
|
#### `@contentEncoding`
|
|
139
139
|
|
|
@@ -145,13 +145,13 @@ Specify the encoding used for the contents of a string.
|
|
|
145
145
|
|
|
146
146
|
##### Target
|
|
147
147
|
|
|
148
|
-
`
|
|
148
|
+
`string | ModelProperty`
|
|
149
149
|
|
|
150
150
|
##### Parameters
|
|
151
151
|
|
|
152
|
-
| Name | Type
|
|
153
|
-
| ----- |
|
|
154
|
-
| value | `valueof
|
|
152
|
+
| Name | Type | Description |
|
|
153
|
+
| ----- | ---------------- | ----------- |
|
|
154
|
+
| value | `valueof string` | <br /> |
|
|
155
155
|
|
|
156
156
|
#### `@contentMediaType`
|
|
157
157
|
|
|
@@ -163,13 +163,13 @@ Specify the content type of content stored in a string.
|
|
|
163
163
|
|
|
164
164
|
##### Target
|
|
165
165
|
|
|
166
|
-
`
|
|
166
|
+
`string | ModelProperty`
|
|
167
167
|
|
|
168
168
|
##### Parameters
|
|
169
169
|
|
|
170
|
-
| Name | Type
|
|
171
|
-
| ----- |
|
|
172
|
-
| value | `valueof
|
|
170
|
+
| Name | Type | Description |
|
|
171
|
+
| ----- | ---------------- | ------------------------------------- |
|
|
172
|
+
| value | `valueof string` | the media type of the string contents |
|
|
173
173
|
|
|
174
174
|
#### `@contentSchema`
|
|
175
175
|
|
|
@@ -182,13 +182,13 @@ media type and encoding.
|
|
|
182
182
|
|
|
183
183
|
##### Target
|
|
184
184
|
|
|
185
|
-
`
|
|
185
|
+
`string | ModelProperty`
|
|
186
186
|
|
|
187
187
|
##### Parameters
|
|
188
188
|
|
|
189
|
-
| Name | Type
|
|
190
|
-
| ----- |
|
|
191
|
-
| value | `
|
|
189
|
+
| Name | Type | Description |
|
|
190
|
+
| ----- | --------- | --------------------------------- |
|
|
191
|
+
| value | `unknown` | the schema of the string contents |
|
|
192
192
|
|
|
193
193
|
#### `@extension`
|
|
194
194
|
|
|
@@ -204,14 +204,14 @@ emit the raw JSON code `{x: "value"}`.
|
|
|
204
204
|
|
|
205
205
|
##### Target
|
|
206
206
|
|
|
207
|
-
`
|
|
207
|
+
`unknown`
|
|
208
208
|
|
|
209
209
|
##### Parameters
|
|
210
210
|
|
|
211
|
-
| Name | Type
|
|
212
|
-
| ----- |
|
|
213
|
-
| key | `valueof
|
|
214
|
-
| value | `
|
|
211
|
+
| Name | Type | Description |
|
|
212
|
+
| ----- | ---------------- | --------------------------------------------------------------------------------------- |
|
|
213
|
+
| key | `valueof string` | the name of the keyword of vendor extension, e.g. `x-custom`. |
|
|
214
|
+
| value | `unknown` | the value of the keyword. Will be converted to a schema unless wrapped in `Json<Data>`. |
|
|
215
215
|
|
|
216
216
|
#### `@id`
|
|
217
217
|
|
|
@@ -226,13 +226,13 @@ By default, the id will be constructed based on the declaration's name.
|
|
|
226
226
|
|
|
227
227
|
##### Target
|
|
228
228
|
|
|
229
|
-
`
|
|
229
|
+
`unknown`
|
|
230
230
|
|
|
231
231
|
##### Parameters
|
|
232
232
|
|
|
233
|
-
| Name | Type
|
|
234
|
-
| ---- |
|
|
235
|
-
| id | `valueof
|
|
233
|
+
| Name | Type | Description |
|
|
234
|
+
| ---- | ---------------- | ----------------------------------------------- |
|
|
235
|
+
| id | `valueof string` | the id of the JSON schema for this declaration. |
|
|
236
236
|
|
|
237
237
|
#### `@jsonSchema`
|
|
238
238
|
|
|
@@ -248,13 +248,13 @@ you can provide the id.
|
|
|
248
248
|
|
|
249
249
|
##### Target
|
|
250
250
|
|
|
251
|
-
`
|
|
251
|
+
`unknown`
|
|
252
252
|
|
|
253
253
|
##### Parameters
|
|
254
254
|
|
|
255
|
-
| Name | Type
|
|
256
|
-
| ------- |
|
|
257
|
-
| baseUri | `valueof
|
|
255
|
+
| Name | Type | Description |
|
|
256
|
+
| ------- | ---------------- | --------------------------------------------------- |
|
|
257
|
+
| baseUri | `valueof string` | Schema IDs are interpreted as relative to this URI. |
|
|
258
258
|
|
|
259
259
|
#### `@maxContains`
|
|
260
260
|
|
|
@@ -267,13 +267,13 @@ by the contains decorator.
|
|
|
267
267
|
|
|
268
268
|
##### Target
|
|
269
269
|
|
|
270
|
-
`
|
|
270
|
+
`unknown[] | ModelProperty`
|
|
271
271
|
|
|
272
272
|
##### Parameters
|
|
273
273
|
|
|
274
|
-
| Name | Type
|
|
275
|
-
| ----- |
|
|
276
|
-
| value | `valueof
|
|
274
|
+
| Name | Type | Description |
|
|
275
|
+
| ----- | --------------- | ------------------------------------------------------ |
|
|
276
|
+
| value | `valueof int32` | The maximum number of instances the array must contain |
|
|
277
277
|
|
|
278
278
|
#### `@maxProperties`
|
|
279
279
|
|
|
@@ -285,13 +285,13 @@ Specify the maximum number of properties this object can have.
|
|
|
285
285
|
|
|
286
286
|
##### Target
|
|
287
287
|
|
|
288
|
-
`
|
|
288
|
+
`Record<unknown> | ModelProperty`
|
|
289
289
|
|
|
290
290
|
##### Parameters
|
|
291
291
|
|
|
292
|
-
| Name | Type
|
|
293
|
-
| ----- |
|
|
294
|
-
| value | `valueof
|
|
292
|
+
| Name | Type | Description |
|
|
293
|
+
| ----- | --------------- | ------------------------------------------------------ |
|
|
294
|
+
| value | `valueof int32` | The maximum number of properties this object can have. |
|
|
295
295
|
|
|
296
296
|
#### `@minContains`
|
|
297
297
|
|
|
@@ -304,13 +304,13 @@ by the contains decorator.
|
|
|
304
304
|
|
|
305
305
|
##### Target
|
|
306
306
|
|
|
307
|
-
`
|
|
307
|
+
`unknown[] | ModelProperty`
|
|
308
308
|
|
|
309
309
|
##### Parameters
|
|
310
310
|
|
|
311
|
-
| Name | Type
|
|
312
|
-
| ----- |
|
|
313
|
-
| value | `valueof
|
|
311
|
+
| Name | Type | Description |
|
|
312
|
+
| ----- | --------------- | ------------------------------------------------------ |
|
|
313
|
+
| value | `valueof int32` | The minimum number of instances the array must contain |
|
|
314
314
|
|
|
315
315
|
#### `@minProperties`
|
|
316
316
|
|
|
@@ -322,13 +322,13 @@ Specify the minimum number of properties this object can have.
|
|
|
322
322
|
|
|
323
323
|
##### Target
|
|
324
324
|
|
|
325
|
-
`
|
|
325
|
+
`Record<unknown> | ModelProperty`
|
|
326
326
|
|
|
327
327
|
##### Parameters
|
|
328
328
|
|
|
329
|
-
| Name | Type
|
|
330
|
-
| ----- |
|
|
331
|
-
| value | `valueof
|
|
329
|
+
| Name | Type | Description |
|
|
330
|
+
| ----- | --------------- | ------------------------------------------------------ |
|
|
331
|
+
| value | `valueof int32` | The minimum number of properties this object can have. |
|
|
332
332
|
|
|
333
333
|
#### `@multipleOf`
|
|
334
334
|
|
|
@@ -340,13 +340,13 @@ Specify that the numeric type must be a multiple of some numeric value.
|
|
|
340
340
|
|
|
341
341
|
##### Target
|
|
342
342
|
|
|
343
|
-
`
|
|
343
|
+
`numeric | ModelProperty`
|
|
344
344
|
|
|
345
345
|
##### Parameters
|
|
346
346
|
|
|
347
|
-
| Name | Type
|
|
348
|
-
| ----- |
|
|
349
|
-
| value | `valueof
|
|
347
|
+
| Name | Type | Description |
|
|
348
|
+
| ----- | ----------------- | -------------------------------------------------- |
|
|
349
|
+
| value | `valueof numeric` | The numeric type must be a multiple of this value. |
|
|
350
350
|
|
|
351
351
|
#### `@prefixItems`
|
|
352
352
|
|
|
@@ -358,13 +358,13 @@ Specify that the target array must begin with the provided types.
|
|
|
358
358
|
|
|
359
359
|
##### Target
|
|
360
360
|
|
|
361
|
-
`
|
|
361
|
+
`unknown[] | ModelProperty`
|
|
362
362
|
|
|
363
363
|
##### Parameters
|
|
364
364
|
|
|
365
|
-
| Name | Type
|
|
366
|
-
| ----- |
|
|
367
|
-
| value | `
|
|
365
|
+
| Name | Type | Description |
|
|
366
|
+
| ----- | ----------- | --------------------------------------------------------------------------- |
|
|
367
|
+
| value | `unknown[]` | a tuple containing the types that must be present at the start of the array |
|
|
368
368
|
|
|
369
369
|
#### `@uniqueItems`
|
|
370
370
|
|
|
@@ -376,7 +376,7 @@ Specify that every item in the array must be unique.
|
|
|
376
376
|
|
|
377
377
|
##### Target
|
|
378
378
|
|
|
379
|
-
`
|
|
379
|
+
`unknown[] | ModelProperty`
|
|
380
380
|
|
|
381
381
|
##### Parameters
|
|
382
382
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/json-schema",
|
|
3
|
-
"version": "0.54.0-dev.
|
|
3
|
+
"version": "0.54.0-dev.3",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec library for emitting TypeSpec to JSON Schema and converting JSON Schema to TypeSpec",
|
|
6
6
|
"homepage": "https://github.com/microsoft/typespec",
|