DGCServerVerifier/apigreen.json

157 lines
4.0 KiB
JSON
Raw Normal View History

2021-09-26 20:00:33 +02:00
{
"openapi": "3.0.0",
"info": {
"contact": {
"name": "Gianmarco Pettianto",
"email": "gianmarco@pettinato.eu",
"url": "jatus.tech"
},
"description": "Endpoint for DGC server",
"title": "green",
"version": "1.0"
},
"servers": [
{
"url": "http://localhost:3000"
}
],
"paths": {
"/api/green": {
"post": {
"tags": [],
"summary": "Sends a request of testing",
"operationId": "post-certificate",
"description": "Checks the greenpass raw data",
"parameters": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Valid-response"
},
"examples": {
"Valid certificate response": {
"value": {
"signature": {
"valid": true
},
"valid": {
"valid": true,
"message": "Certificate is valid"
},
"info": {
"identity": {
"fnt": "ROSSI",
"fn": "ROSSI",
"gnt": "MARIO",
"gn": "MARIO"
},
"dob": "1973-06-22"
}
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Valid-response": {
"description": "",
"type": "object",
2021-09-26 20:30:50 +02:00
"x-examples": {},
2021-09-26 20:00:33 +02:00
"properties": {
"signature": {
"type": "object",
"required": [
"valid"
],
"properties": {
"valid": {
"type": "boolean"
}
}
},
"valid": {
"type": "object",
"required": [
"valid",
"message"
],
"properties": {
"valid": {
"type": "boolean"
},
"message": {
"type": "string",
2021-09-26 20:30:50 +02:00
"enum": [
"Certificate is valid",
"The test detected the virus",
"Invaild set of rules check with operator",
"Certificate is not valid",
"The test detected the virus",
"unknown test type",
"Certificate is not valid yet",
"nd"
],
"example": null
2021-09-26 20:00:33 +02:00
}
}
},
"info": {
"type": "object",
"required": [
"identity",
"dob"
],
"properties": {
"identity": {
"type": "object",
"required": [
"fnt",
"fn",
"gnt",
"gn"
],
"properties": {
"fnt": {
"type": "string",
"minLength": 1
},
"fn": {
"type": "string",
"minLength": 1
},
"gnt": {
"type": "string",
"minLength": 1
},
"gn": {
"type": "string",
"minLength": 1
}
}
},
"dob": {
"type": "string",
2021-09-26 20:30:50 +02:00
"minLength": 1,
"format": "date"
2021-09-26 20:00:33 +02:00
}
}
}
},
"required": [
"signature",
"valid",
"info"
]
}
}
}
}