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

Add field.examples, deprecate field.example #93

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ models:
description: The business timestamp in UTC when the order was successfully registered in the source system and the payment was successful.
type: timestamp
required: true
example: "2024-09-09T08:30:00Z"
examples:
- "2024-09-09T08:30:00Z"
order_total:
description: Total amount the smallest monetary unit (e.g., cents).
type: long
required: true
example: "9999"
examples:
- 9999
customer_id:
description: Unique identifier for the customer.
type: text
Expand Down Expand Up @@ -143,7 +145,8 @@ definitions:
type: text
format: uuid
description: An internal ID that identifies an order in the online shop.
example: 243c25e5-a081-43a9-aeab-6d5d5b6cb5e2
examples:
- 243c25e5-a081-43a9-aeab-6d5d5b6cb5e2
pii: true
classification: restricted
tags:
Expand All @@ -154,7 +157,8 @@ definitions:
title: Stock Keeping Unit
type: text
pattern: ^[A-Za-z0-9]{8,14}$
example: "96385074"
examples:
- "96385074"
description: |
A Stock Keeping Unit (SKU) is an internal unique identifier for an article.
It is typically associated with an article's barcode, such as the EAN/GTIN.
Expand Down Expand Up @@ -583,7 +587,8 @@ The Field Objects describes one field (column, property, nested field) of a data
| exclusiveMinimum | `number` | A value of a number must greater than the value of this. Only evaluated if the value is not null. Only applies to numeric values. |
| maximum | `number` | A value of a number must less than, or equal to, the value of this. Only evaluated if the value is not null. Only applies to numeric values. |
| exclusiveMaximum | `number` | A value of a number must less than the value of this. Only evaluated if the value is not null. Only applies to numeric values. |
| example | `string` | An example value. |
| example | `string` | DEPRECATED. Use `examples` instead. An example value. |
| examples | `array` | Example values. |
| pii | `boolean` | An indication, if this field contains Personal Identifiable Information (PII). |
| classification | `string` | The data class defining the sensitivity level for this field, according to the organization's classification scheme. Examples may be: `sensitive`, `restricted`, `internal`, `public`. |
| tags | Array of `string` | Custom metadata to provide additional context. |
Expand Down Expand Up @@ -622,7 +627,8 @@ Models fields can refer to definitions using the `$ref` field to link to existin
| exclusiveMinimum | `number` | A value of a number must greater than the value of this. Only evaluated if the value is not null. Only applies to numeric values. |
| maximum | `number` | A value of a number must less than, or equal to, the value of this. Only evaluated if the value is not null. Only applies to numeric values. |
| exclusiveMaximum | `number` | A value of a number must less than the value of this. Only evaluated if the value is not null. Only applies to numeric values. |
| example | `string` | An example value. |
| example | `string` | DEPRECATED. Use `examples` instead. An example value. |
| examples | `array` | Example values. |
| pii | `boolean` | An indication, if this field contains Personal Identifiable Information (PII). |
| classification | `string` | The data class defining the sensitivity level for this field, according to the organization's classification scheme. |
| tags | Array of `string` | Custom metadata to provide additional context. |
Expand Down
12 changes: 11 additions & 1 deletion datacontract.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,13 @@
},
"example": {
"type": "string",
"deprecationMessage": "DEPRECATED. Use 'examples' instead.",
"description": "An example value for this field."
},
"examples": {
"type": "array",
"description": "Example values for this field."
},
"pii": {
"type": "boolean",
"description": "An indication, if this field contains Personal Identifiable Information (PII)."
Expand Down Expand Up @@ -1167,7 +1172,12 @@
},
"example": {
"type": "string",
"description": "An example value."
"description": "An example value.",
"deprecationMessage": "DEPRECATED. Use 'examples' instead."
},
"examples": {
"type": "array",
"description": "Example values."
},
"pii": {
"type": "boolean",
Expand Down
7 changes: 6 additions & 1 deletion definition.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
},
"example": {
"type": "string",
"description": "An example value."
"description": "An example value.",
"deprecationMessage": "Use 'examples' instead."
},
"examples": {
"type": "array",
"description": "Example values."
},
"pii": {
"type": "boolean",
Expand Down