-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added comparison between generated json schema and expected ones in u…
…nit tests
- Loading branch information
gcornacchia
committed
Nov 28, 2024
1 parent
769b80b
commit 2085fc6
Showing
30 changed files
with
1,609 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/test/resources/expectedJsonSchemas/petstoreInvalidRegex.json/error.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"components" : { | ||
"schemas" : { } | ||
}, | ||
"$schema" : "http://json-schema.org/draft-04/schema#", | ||
"additionalProperties" : false, | ||
"title" : "Error", | ||
"type" : "object", | ||
"properties" : { | ||
"code" : { | ||
"type" : "integer", | ||
"format" : "int32" | ||
}, | ||
"message" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"required" : [ "code", "message" ] | ||
} |
179 changes: 179 additions & 0 deletions
179
src/test/resources/expectedJsonSchemas/petstoreInvalidRegex.json/pets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
{ | ||
"components" : { | ||
"schemas" : { | ||
"Pet" : { | ||
"required" : [ "id", "name" ], | ||
"type" : "object", | ||
"properties" : { | ||
"id" : { | ||
"type" : "integer", | ||
"format" : "int64" | ||
}, | ||
"name" : { | ||
"pattern" : "^(?!\\s*$){1,34}$", | ||
"type" : "string" | ||
}, | ||
"tag" : { | ||
"type" : "string" | ||
}, | ||
"extraInfo" : { | ||
"$ref" : "#/components/schemas/Info" | ||
}, | ||
"objectNoProps" : { | ||
"$ref" : "#/components/schemas/Info6" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Info" : { | ||
"type" : "object", | ||
"properties" : { | ||
"code" : { | ||
"type" : "string" | ||
}, | ||
"surname" : { | ||
"type" : "string" | ||
}, | ||
"nested" : { | ||
"$ref" : "#/components/schemas/Info2" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Info2" : { | ||
"required" : [ "pippo", "pluto" ], | ||
"type" : "object", | ||
"properties" : { | ||
"pippo" : { | ||
"type" : "string" | ||
}, | ||
"pluto" : { | ||
"type" : "string" | ||
}, | ||
"circularInfo" : { | ||
"$ref" : "#/components/schemas/Info" | ||
}, | ||
"elements" : { | ||
"type" : "array", | ||
"items" : { | ||
"$ref" : "#/components/schemas/Info3" | ||
} | ||
}, | ||
"new" : { | ||
"type" : "object", | ||
"properties" : { | ||
"y" : { | ||
"type" : "string" | ||
}, | ||
"x" : { | ||
"$ref" : "#/components/schemas/Info5" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Info3" : { | ||
"required" : [ "test" ], | ||
"type" : "object", | ||
"properties" : { | ||
"test" : { | ||
"type" : "string" | ||
}, | ||
"elements2" : { | ||
"type" : "array", | ||
"items" : { | ||
"type" : "object", | ||
"properties" : { | ||
"test" : { | ||
"type" : "string" | ||
}, | ||
"obj" : { | ||
"$ref" : "#/components/schemas/Info4" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
} | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Info4" : { | ||
"type" : "object", | ||
"properties" : { | ||
"test2" : { | ||
"type" : "string" | ||
}, | ||
"map" : { | ||
"type" : "object", | ||
"additionalProperties" : true | ||
}, | ||
"field" : { | ||
"$ref" : "#/components/schemas/Info9" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Info5" : { | ||
"type" : "object", | ||
"properties" : { | ||
"test3" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Info6" : { | ||
"type" : "object", | ||
"additionalProperties" : true | ||
}, | ||
"Info7" : { | ||
"properties" : { | ||
"test4" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"allOf" : [ { | ||
"$ref" : "#/components/schemas/BaseModel" | ||
} ] | ||
}, | ||
"BaseModel" : { | ||
"type" : "object", | ||
"properties" : { | ||
"base" : { | ||
"type" : "string" | ||
}, | ||
"other" : { | ||
"$ref" : "#/components/schemas/Info8" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Info8" : { | ||
"type" : "object", | ||
"properties" : { | ||
"xy" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Info9" : { | ||
"type" : "object", | ||
"properties" : { | ||
"zz" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
} | ||
} | ||
}, | ||
"$schema" : "http://json-schema.org/draft-04/schema#", | ||
"title" : "Pets", | ||
"type" : "array", | ||
"items" : { | ||
"$ref" : "#/components/schemas/Pet" | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/test/resources/expectedJsonSchemas/petstoreNoBody.json/getpetsresponse200.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"components" : { | ||
"schemas" : { | ||
"Pet" : { | ||
"required" : [ "name" ], | ||
"type" : "object", | ||
"properties" : { | ||
"name" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
} | ||
} | ||
}, | ||
"$schema" : "http://json-schema.org/draft-04/schema#", | ||
"title" : "getPetsresponse200", | ||
"type" : "array", | ||
"items" : { | ||
"$ref" : "#/components/schemas/Pet" | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...rces/expectedJsonSchemas/petstoreoas3-remoteref.json/createuserswithlistinputrequest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"components" : { | ||
"schemas" : { | ||
"User" : { | ||
"type" : "object", | ||
"properties" : { | ||
"id" : { | ||
"type" : "integer", | ||
"format" : "int64" | ||
}, | ||
"username" : { | ||
"type" : "string" | ||
}, | ||
"firstName" : { | ||
"type" : [ "string", "null" ] | ||
}, | ||
"lastName" : { | ||
"type" : "string" | ||
}, | ||
"email" : { | ||
"type" : "string" | ||
}, | ||
"password" : { | ||
"type" : "string" | ||
}, | ||
"phone" : { | ||
"type" : "string" | ||
}, | ||
"userStatus" : { | ||
"type" : "integer", | ||
"description" : "User Status", | ||
"format" : "int32" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
} | ||
} | ||
}, | ||
"$schema" : "http://json-schema.org/draft-04/schema#", | ||
"title" : "createUsersWithListInputrequest", | ||
"type" : "array", | ||
"items" : { | ||
"$ref" : "#/components/schemas/User" | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
...esources/expectedJsonSchemas/petstoreoas3-remoteref.json/findpetsbystatusresponse200.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"components" : { | ||
"schemas" : { | ||
"Pet" : { | ||
"required" : [ "name", "photoUrls" ], | ||
"type" : "object", | ||
"properties" : { | ||
"id" : { | ||
"type" : "integer", | ||
"format" : "int64" | ||
}, | ||
"name" : { | ||
"type" : [ "string", "null" ] | ||
}, | ||
"category" : { | ||
"$ref" : "#/components/schemas/Category" | ||
}, | ||
"photoUrls" : { | ||
"type" : "array", | ||
"items" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"tags" : { | ||
"type" : "array", | ||
"items" : { | ||
"$ref" : "#/components/schemas/Tag" | ||
} | ||
}, | ||
"status" : { | ||
"type" : "string", | ||
"description" : "pet status in the store", | ||
"enum" : [ "available", "pending", "sold" ] | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Category" : { | ||
"type" : "object", | ||
"properties" : { | ||
"id" : { | ||
"type" : "integer", | ||
"format" : "int64" | ||
}, | ||
"name" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
}, | ||
"Tag" : { | ||
"type" : "object", | ||
"properties" : { | ||
"id" : { | ||
"type" : "integer", | ||
"format" : "int64" | ||
}, | ||
"name" : { | ||
"type" : "string" | ||
} | ||
}, | ||
"additionalProperties" : false | ||
} | ||
} | ||
}, | ||
"$schema" : "http://json-schema.org/draft-04/schema#", | ||
"title" : "findPetsByStatusresponse200", | ||
"type" : "array", | ||
"items" : { | ||
"$ref" : "#/components/schemas/Pet" | ||
} | ||
} |
Oops, something went wrong.