File size: 1,695 Bytes
a5a6006
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from error_handling import ErrorCodes

def get_error_codes_description():
    description = "| code | description |\n| - | - |\n"
    error_codes_description = []
    for error_code in ErrorCodes:
        error_codes_description.append(
            f"| {error_code.value[0]} | {error_code.value[1]} |\n"
        )
    list.sort(error_codes_description)
    description = f"{description}{''.join(error_codes_description)}"
    return description


components_dict = {
    "schemas": {
        "ErrorMessage": {
            "required": ["errors"],
            "description": get_error_codes_description(),
            "properties": {
                "errors": {
                    "type": "array",
                    "title": "Error array",
                    "items": {
                        "type": "object",
                        "required": ["code", "message"],
                        "properties": {
                            "code": {"type": "integer", "example": 400},
                            "message": {
                                "type": "string",
                                "example": "'input_text' is a required property",
                                "maxLength": 256,
                            },
                        },
                    },
                }
            },
        }
    },
    "paths": {
        "/api/generatel-language": {
            "parameters": [
                {
                    "name": "petId",
                    "in": "path",
                    "schema": {
                        "type": "integer",
                        "format": "int64"
                    }
                }
            ]
        }
    }
}