Skip to content

Commit

Permalink
feat: Explicitly specify schema version
Browse files Browse the repository at this point in the history
  • Loading branch information
vwong committed Jul 31, 2023
1 parent 090bb69 commit 2b1436b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/pact-schema-v1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Pact V1",
"description": "Schema for a Pact file",
"definitions": {
Expand Down
1 change: 1 addition & 0 deletions dist/pact-schema-v2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Pact V2",
"description": "Schema for a Pact file",
"definitions": {
Expand Down
1 change: 1 addition & 0 deletions dist/pact-schema-v3.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Pact V3",
"description": "Schema for a Pact file",
"definitions": {
Expand Down
1 change: 1 addition & 0 deletions dist/pact-schema-v4.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Pact V4",
"description": "Schema for a Pact file",
"definitions": {
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ import { pacticipant } from "./pacticipant";
import { request, requestV2, requestV3, requestV4 } from "./request";
import { response, responseV2, responseV3, responseV4 } from "./response";

const $schema = "http://json-schema.org/draft-07/schema";

export const PactV1Schema = Type.Strict(
Type.Object(
{
Expand All @@ -67,6 +69,7 @@ export const PactV1Schema = Type.Strict(
provider: Type.Ref(pacticipant),
},
{
$schema,
title: "Pact V1",
description: "Schema for a Pact file",
definitions: {
Expand All @@ -91,6 +94,7 @@ export const PactV2Schema = Type.Strict(
provider: Type.Ref(pacticipant),
},
{
$schema,
title: "Pact V2",
description: "Schema for a Pact file",
definitions: {
Expand Down Expand Up @@ -119,6 +123,7 @@ export const PactV3Schema = Type.Strict(
provider: Type.Ref(pacticipant),
},
{
$schema,
title: "Pact V3",
description: "Schema for a Pact file",
definitions: {
Expand Down Expand Up @@ -176,6 +181,7 @@ export const PactV4Schema = Type.Strict(
provider: Type.Ref(pacticipant),
},
{
$schema,
title: "Pact V4",
description: "Schema for a Pact file",
definitions: {
Expand Down

0 comments on commit 2b1436b

Please sign in to comment.