Skip to content

Commit

Permalink
added comparison between generated json schema and expected ones in u…
Browse files Browse the repository at this point in the history
…nit tests
  • Loading branch information
gcornacchia committed Nov 28, 2024
1 parent 769b80b commit 2085fc6
Show file tree
Hide file tree
Showing 30 changed files with 1,609 additions and 0 deletions.
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" ]
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
Loading

0 comments on commit 2085fc6

Please sign in to comment.