@ancplua/qyl-api-schema 0.6.0 → 1.0.0

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 CHANGED
@@ -63,14 +63,16 @@ npm run compile
63
63
  Important generated outputs include:
64
64
 
65
65
  - `generated/openapi/qyl.openapi.json`
66
- - `generated/json-schema/qyl-api-schema`
66
+ - `generated/json-schema/qyl-api-schema.json`
67
67
  - `generated/contracts/**/*.cs`
68
68
  - `generated/ts-types/**`
69
69
 
70
70
  Generated files are not editing surfaces. OpenAPI comes from the official TypeSpec
71
71
  emitter; the bundled JSON Schema is a deterministic projection of its component
72
- schemas so both artifacts preserve the same wire names. Change TypeSpec or the
73
- owning generator and regenerate.
72
+ schemas and exposes inline route bodies as stable
73
+ `Operations.<operationId>.Request` and
74
+ `Operations.<operationId>.Response.<status>` definitions. Both artifacts preserve
75
+ the same wire names. Change TypeSpec or the owning generator and regenerate.
74
76
 
75
77
  ## Publish
76
78
 
package/common/types.tsp CHANGED
@@ -215,24 +215,53 @@ model AttributeBytesValue {
215
215
  base64: bytes;
216
216
  }
217
217
 
218
- @doc("Recursive OTLP key-value-list projected as a JSON object.")
218
+ @doc("An OTLP signed 64-bit attribute integer encoded without JavaScript precision loss.")
219
+ @encode(string)
220
+ @TypeSpec.OpenAPI.extension("x-csharp-type", "long")
221
+ scalar AttributeInt64 extends int64;
222
+
223
+ @doc("An OTLP attribute double encoded as a JSON number when finite or a canonical named string when non-finite.")
224
+ union AttributeDouble {
225
+ finite: float64,
226
+ nan: "NaN",
227
+ positiveInfinity: "Infinity",
228
+ negativeInfinity: "-Infinity",
229
+ }
230
+
231
+ @doc("Tagged OTLP signed 64-bit integer attribute.")
232
+ model AttributeIntValue {
233
+ type: "int";
234
+ value: AttributeInt64;
235
+ }
236
+
237
+ @doc("Tagged OTLP double attribute.")
238
+ model AttributeDoubleValue {
239
+ type: "double";
240
+ value: AttributeDouble;
241
+ }
242
+
243
+ @doc("Tagged recursive OTLP key-value-list, distinct from other object-shaped attribute variants.")
219
244
  model AttributeKeyValueListValue {
220
- ...Record<AttributeValue>;
245
+ type: "kvlist";
246
+ values: Record<AttributeValue>;
221
247
  }
222
248
 
223
249
  @doc("Lossless JSON projection of an OpenTelemetry AnyValue attribute.")
224
250
  union AttributeValue {
251
+ @doc("Empty AnyValue")
252
+ emptyValue: null,
253
+
225
254
  @doc("String value")
226
255
  stringValue: string,
227
256
 
228
257
  @doc("Boolean value")
229
258
  boolValue: boolean,
230
259
 
231
- @doc("64-bit integer value")
232
- intValue: int64,
260
+ @doc("Lossless 64-bit integer value")
261
+ intValue: AttributeIntValue,
233
262
 
234
- @doc("64-bit floating point value")
235
- doubleValue: float64,
263
+ @doc("Lossless finite or non-finite 64-bit floating point value")
264
+ doubleValue: AttributeDoubleValue,
236
265
 
237
266
  @doc("Bytes value projected as an explicit tagged object")
238
267
  bytesValue: AttributeBytesValue,
@@ -261,6 +290,30 @@ model Attributes {
261
290
  items: Attribute[];
262
291
  }
263
292
 
293
+ @doc("A non-empty Resource attribute key referenced by an OpenTelemetry entity.")
294
+ @minLength(1)
295
+ scalar EntityAttributeKey extends string;
296
+
297
+ @doc("A reference to an OpenTelemetry entity described by attributes on the containing Resource.")
298
+ model EntityRef {
299
+ @doc("Schema URL applying to the entity and its referenced Resource attributes, when known.")
300
+ @encodedName("application/json", "schema_url")
301
+ schemaUrl?: string;
302
+
303
+ @doc("Stable non-empty entity type, such as service or host.")
304
+ @minLength(1)
305
+ type: string;
306
+
307
+ @doc("Non-empty set of Resource attribute keys that identify the entity.")
308
+ @encodedName("application/json", "id_keys")
309
+ @minItems(1)
310
+ idKeys: EntityAttributeKey[];
311
+
312
+ @doc("Resource attribute keys that describe but do not identify the entity.")
313
+ @encodedName("application/json", "description_keys")
314
+ descriptionKeys?: EntityAttributeKey[];
315
+ }
316
+
264
317
  // =============================================================================
265
318
  // Instrumentation Scope
266
319
  // =============================================================================