Skip to content

Commit

Permalink
- Add EasyVCR .NET schema, catalog entry, test (#4216)
Browse files Browse the repository at this point in the history
* - Add EasyVCR .NET schema, catalog entry, test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* - Fix additionalProperties

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
nwithan8 and pre-commit-ci[bot] authored Nov 16, 2024
1 parent cbc9201 commit 62ded88
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,12 @@
"fileMatch": ["eas.json"],
"url": "https://raw.githubusercontent.com/expo/eas-cli/main/packages/eas-json/schema/eas.schema.json"
},
{
"name": "EasyVCR .NET",
"description": "EasyVCR .NET recording file",
"fileMatch": ["*.easyvcr", "**/cassettes/*.json"],
"url": "https://json.schemastore.org/easyvcr-net.json"
},
{
"name": "ezd task runner",
"description": "ezd task runner. Documentation: https://gitlab.com/sbenv/veroxis/ezd-rs",
Expand Down
111 changes: 111 additions & 0 deletions src/schemas/json/easyvcr-net.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/easyvcr-net",
"$comment": "https://github.com/EasyPost/easyvcr-csharp",
"title": "EasyVCR .NET cassette",
"description": "A schema for an EasyVCR .NET recording\nhttps://github.com/EasyPost/easyvcr-csharp",
"type": "array",
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"Duration": {
"title": "Duration",
"description": "How long, in milliseconds, the recorded request took to complete",
"type": "integer"
},
"RecordedAt": {
"title": "Recorded at",
"description": "When the request was recorded",
"type": "string",
"format": "date-time"
},
"Request": {
"title": "Request",
"description": "The request that was recorded",
"type": "object",
"properties": {
"Body": {
"title": "Body",
"description": "The request body",
"type": "string"
},
"BodyContentType": {
"title": "Body content type",
"description": "The type of content in the request body",
"type": "string"
},
"ContentHeaders": {
"title": "Content headers",
"description": "The request content headers",
"type": "object"
},
"Method": {
"title": "Method",
"description": "The HTTP method",
"type": "string"
},
"RequestHeaders": {
"title": "Request headers",
"description": "The request headers",
"type": "object"
},
"Uri": {
"title": "Uri",
"description": "The request URI",
"type": "string"
}
}
},
"Response": {
"title": "Response",
"description": "The response that was recorded",
"type": "object",
"properties": {
"Body": {
"title": "Body",
"description": "The response body",
"type": "string"
},
"BodyContentType": {
"title": "Body content type",
"description": "The type of content in the response body",
"type": "string"
},
"ContentHeaders": {
"title": "Content headers",
"description": "The response content headers",
"type": "object"
},
"HttpVersion": {
"title": "HTTP version",
"description": "The HTTP version",
"type": "string"
},
"ResponseHeaders": {
"title": "Response headers",
"description": "The response headers",
"type": "object"
},
"Status": {
"title": "Status",
"description": "The HTTP status",
"type": "object",
"properties": {
"Code": {
"title": "Code",
"description": "The HTTP status code",
"type": "integer"
},
"Message": {
"title": "Description",
"description": "The HTTP status code description",
"type": "string"
}
}
}
}
}
}
}
}
38 changes: 38 additions & 0 deletions src/test/easyvcr-net/cassette.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"Duration": 89,
"RecordedAt": "2024-02-09T16:37:40.475353-07:00",
"Request": {
"Body": "",
"BodyContentType": "Text",
"ContentHeaders": {},
"Method": "GET",
"RequestHeaders": {
"X-Custom-Header1": "custom-value1",
"X-Custom-Header2": "custom-value2"
},
"Uri": "https://api.ipify.org/?format=json"
},
"Response": {
"Body": "{\"ip\":\"not.a.real.ip\"}",
"BodyContentType": "Json",
"ContentHeaders": {
"Content-Length": "23",
"Content-Type": "application/json"
},
"HttpVersion": "1.1",
"ResponseHeaders": {
"CF-Cache-Status": "DYNAMIC",
"CF-RAY": "852ff10c6b425203-DEN",
"Connection": "keep-alive",
"Date": "Fri, 09 Feb 2024 23:37:40 GMT",
"Server": "cloudflare",
"Vary": "Origin"
},
"Status": {
"Code": 200,
"Message": "OK"
}
}
}
]

0 comments on commit 62ded88

Please sign in to comment.