Skip to content

Commit

Permalink
Added descriptions for json schema items
Browse files Browse the repository at this point in the history
  • Loading branch information
evg4b committed Nov 30, 2024
1 parent 5c7526a commit 9a17a57
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 18 deletions.
22 changes: 13 additions & 9 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
"additionalProperties": false,
"definitions": {
"Duration": {
"description": "Duration in human-readable format",
"description": "Duration in human-readable format. Supported units are 'h' (hours), 'm' (minutes), 's' (seconds), 'ms' (milliseconds), 'us' (microseconds), 'ns' (nanoseconds).",
"examples": [
"1h",
"1h 30m",
"1h 30m 15s",
"1h 30m 15s 500ms",
"1h 30m 15s 500ms 100us",
"1h 30m 15s 500ms 100us 50ns"
"3s",
"1m 30s",
"500ms",
"1h 30m 15s 500ms 100us 200ns"
],
"pattern": "^(\\d+h)?\\s*(\\d+m)?\\s*(\\d+s)?\\s*(\\d+ms)?\\s*(\\d+(us|µs))?\\s*(\\d+(ns))?$",
"title": "Duration",
"type": "string"
},
"FakeDataMockResponse": {
"additionalProperties": false,
"description": "Mock response definition based on fake data content",
"properties": {
"code": {
"$ref": "#/definitions/StatusCode"
"$ref": "#/definitions/StatusCode",
"description": "HTTP status code which will be sent in the mock response"
},
"delay": {
"$ref": "#/definitions/Duration",
Expand Down Expand Up @@ -3369,7 +3369,8 @@
"description": "Mock response definition based on file content",
"properties": {
"code": {
"$ref": "#/definitions/StatusCode"
"$ref": "#/definitions/StatusCode",
"description": "HTTP status code which will be sent in the mock response"
},
"delay": {
"$ref": "#/definitions/Duration",
Expand All @@ -3394,6 +3395,7 @@
"additionalProperties": {
"type": "string"
},
"description": "HTTP headers definition",
"minProperties": 1,
"type": "object"
},
Expand Down Expand Up @@ -3512,6 +3514,7 @@
"additionalProperties": {
"type": "string"
},
"description": "HTTP query parameters definition",
"minProperties": 1,
"type": "object"
},
Expand Down Expand Up @@ -3543,6 +3546,7 @@
},
"StaticDirectory": {
"additionalProperties": false,
"description": "Static serving directory definition",
"properties": {
"dir": {
"description": "Path to the folder from which the static files will be served",
Expand Down
13 changes: 6 additions & 7 deletions tools/schema/definitions/Duration.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "string",
"pattern": "^(\\d+h)?\\s*(\\d+m)?\\s*(\\d+s)?\\s*(\\d+ms)?\\s*(\\d+(us|µs))?\\s*(\\d+(ns))?$",
"description": "Duration in human-readable format",
"title": "Duration",
"description": "Duration in human-readable format. Supported units are 'h' (hours), 'm' (minutes), 's' (seconds), 'ms' (milliseconds), 'us' (microseconds), 'ns' (nanoseconds).",
"examples": [
"1h",
"1h 30m",
"1h 30m 15s",
"1h 30m 15s 500ms",
"1h 30m 15s 500ms 100us",
"1h 30m 15s 500ms 100us 50ns"
"3s",
"1m 30s",
"500ms",
"1h 30m 15s 500ms 100us 200ns"
]
}
3 changes: 2 additions & 1 deletion tools/schema/definitions/FakeDataMockResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Mock response definition based on fake data content",
"properties": {
"code": {
"$ref": "#/definitions/StatusCode"
"$ref": "#/definitions/StatusCode",
"description": "HTTP status code which will be sent in the mock response"
},
"delay": {
"$ref": "#/definitions/Duration",
Expand Down
3 changes: 2 additions & 1 deletion tools/schema/definitions/FileMockResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Mock response definition based on file content",
"properties": {
"code": {
"$ref": "#/definitions/StatusCode"
"$ref": "#/definitions/StatusCode",
"description": "HTTP status code which will be sent in the mock response"
},
"delay": {
"$ref": "#/definitions/Duration",
Expand Down
1 change: 1 addition & 0 deletions tools/schema/definitions/Headers.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "HTTP headers definition",
"additionalProperties": {
"type": "string"
},
Expand Down
1 change: 1 addition & 0 deletions tools/schema/definitions/Queries.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "HTTP query parameters definition",
"additionalProperties": {
"type": "string"
},
Expand Down
1 change: 1 addition & 0 deletions tools/schema/definitions/StaticDirectory.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Static serving directory definition",
"properties": {
"path": {
"type": "string",
Expand Down

0 comments on commit 9a17a57

Please sign in to comment.