Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when a json schema is defined with --spec option #172

Open
agustin-jimenez opened this issue Sep 24, 2020 · 6 comments
Open

TypeError when a json schema is defined with --spec option #172

agustin-jimenez opened this issue Sep 24, 2020 · 6 comments
Labels

Comments

@agustin-jimenez
Copy link

agustin-jimenez commented Sep 24, 2020

When I defined --spect option with a json schema the software raises the following error:

  $ http-prompt http://127.0.0.1:8080 --spec=http://127.0.0.1:8080/api.json
Version: 1.0.0
Traceback (most recent call last):
  File "/home/__USERNAME__/.local/bin/http-prompt", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1066
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 610,
    return callback(*args, **kwargs)
  File "/home/__USERNAME__/.local/lib/python3.8/site-packages/http_promp
    context = Context(url, spec=spec)
  File "/home/__USERNAME__/.local/lib/python3.8/site-packages/http_promp
, in __init__
    params = info.get('parameters')
AttributeError: 'list' object has no attribute 'get'
@agustin-jimenez
Copy link
Author

agustin-jimenez commented Sep 24, 2020

I put this little piece of code in the following file and the software didn't raises this error anymore.

# path: $USER/.local/lib/python3.8/site-packages/http_prompt/context/__init__.py

if 'dict' in str(type(info)):
params = info.get('parameters')
if 'list' in str(type(info)):
if 'parameters' in info:
    params = info[info.index('parameters')]

I put this code before the line 38. But if you ask me... the code isn't clean at all. I'm so sorry, I don't have time for sending a pull request.

Your software is so cool and I found it awesome! So thanks!

@jkbrzt
Copy link
Member

jkbrzt commented Sep 28, 2020

@agustin-jimenez thanks for the report! Could you share the spec file?

@jkbrzt jkbrzt added the bug label Sep 28, 2020
@agustin-jimenez
Copy link
Author

agustin-jimenez commented Sep 28, 2020

{
    "swagger": "2.0",
    "info": {
        "title": "API",
        "description": "",
        "termsOfService": "NOT DEFINED",
        "contact": {
            "email": ""
        },
        "license": {
            "name": "NOT DEFINED"
        },
        "version": "v1"
    },
    "host": "127.0.0.1:8080",
    "schemes": [
        "http"
    ],
    "basePath": "/api",
    "consumes": [
        "application/json"
    ],
    "produces": [
        "application/json"
    ],
    "securityDefinitions": {
        "token": {
            "type": "token",
            "name": "token",
            "in": "header",
            "authorizationUrl": "api/token/"
        }
    },
    "security": [
        {
            "token": []
        }
    ],
    "paths": {
        "/brand/": {
            "get": {
                "operationId": "brand_list",
                "description": "Listing brands endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/Brand"
                            }
                        }
                    }
                },
                "tags": [
                    "brand"
                ]
            },
            "parameters": []
        },
        "/brand/models/{id}/": {
            "get": {
                "operationId": "brand_models_read",
                "description": "",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/ModelsOfABrands"
                        }
                    }
                },
                "tags": [
                    "brand"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this brand.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/brand/{id}/": {
            "get": {
                "operationId": "brand_read",
                "description": "Listing brands endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Brand"
                        }
                    }
                },
                "tags": [
                    "brand"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this brand.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/cars/": {
            "get": {
                "operationId": "cars_list",
                "description": "Defines the Car endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/CarGetting"
                            }
                        }
                    }
                },
                "tags": [
                    "cars"
                ]
            },
            "post": {
                "operationId": "cars_create",
                "description": "Defines the Car endpoint",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/CarCreating"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/CarCreating"
                        }
                    }
                },
                "tags": [
                    "cars"
                ]
            },
            "parameters": []
        },
        "/cars/{id}/": {
            "get": {
                "operationId": "cars_read",
                "description": "Defines the Car endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/CarGetting"
                        }
                    }
                },
                "tags": [
                    "cars"
                ]
            },
            "put": {
                "operationId": "cars_update",
                "description": "Defines the Car endpoint",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/CarGeneral"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/CarGeneral"
                        }
                    }
                },
                "tags": [
                    "cars"
                ]
            },
            "patch": {
                "operationId": "cars_partial_update",
                "description": "Defines the Car endpoint",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/CarGeneral"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/CarGeneral"
                        }
                    }
                },
                "tags": [
                    "cars"
                ]
            },
            "delete": {
                "operationId": "cars_delete",
                "description": "Defines the Car endpoint",
                "parameters": [],
                "responses": {
                    "204": {
                        "description": ""
                    }
                },
                "tags": [
                    "cars"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this car.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/location/address/": {
            "get": {
                "operationId": "location_address_list",
                "description": "Address endpoint. Handles the address of an user.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/Address"
                            }
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "post": {
                "operationId": "location_address_create",
                "description": "Address endpoint. Handles the address of an user.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Address"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Address"
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": []
        },
        "/location/address/{id}/": {
            "put": {
                "operationId": "location_address_update",
                "description": "Address endpoint. Handles the address of an user.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Address"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Address"
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "patch": {
                "operationId": "location_address_partial_update",
                "description": "Address endpoint. Handles the address of an user.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Address"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Address"
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "delete": {
                "operationId": "location_address_delete",
                "description": "Address endpoint. Handles the address of an user.",
                "parameters": [],
                "responses": {
                    "204": {
                        "description": ""
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this address.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/location/branch_office/": {
            "get": {
                "operationId": "location_branch_office_list",
                "description": "Get only endpoint for the Offices",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/BranchOffice"
                            }
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": []
        },
        "/location/branch_office/{id}/": {
            "get": {
                "operationId": "location_branch_office_read",
                "description": "Get only endpoint for the Offices",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/BranchOffice"
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this branch office.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/location/country/": {
            "get": {
                "operationId": "location_country_list",
                "description": "Listing countries endpoint.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/Country"
                            }
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": []
        },
        "/location/country/provinces/{id}/": {
            "get": {
                "operationId": "location_country_provinces_read",
                "description": "Retrieve only endpoint for listing the provinces that a country\nhas",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/ProvincesOfACountry"
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this country.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/location/country/{id}/": {
            "get": {
                "operationId": "location_country_read",
                "description": "Listing countries endpoint.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Country"
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this country.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/location/province/": {
            "get": {
                "operationId": "location_province_list",
                "description": "Listing countries endpoint.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/Province"
                            }
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": []
        },
        "/location/province/{id}/": {
            "get": {
                "operationId": "location_province_read",
                "description": "Listing countries endpoint.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Province"
                        }
                    }
                },
                "tags": [
                    "location"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this province.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/model/": {
            "get": {
                "operationId": "model_list",
                "description": "Listing car models endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/CarModel"
                            }
                        }
                    }
                },
                "tags": [
                    "model"
                ]
            },
            "parameters": []
        },
        "/model/year-price/{id}/": {
            "get": {
                "operationId": "model_year-price_read",
                "description": "",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/CarModelPricesPerYear"
                        }
                    }
                },
                "tags": [
                    "model"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this car model.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/model/{id}/": {
            "get": {
                "operationId": "model_read",
                "description": "Listing car models endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/CarModel"
                        }
                    }
                },
                "tags": [
                    "model"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this car model.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/rental/p2p/post/": {
            "get": {
                "operationId": "rental_p2p_post_list",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/CarPostGetting"
                            }
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "post": {
                "operationId": "rental_p2p_post_create",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/P2PCarPost"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/P2PCarPost"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "parameters": []
        },
        "/rental/p2p/post/{id}/": {
            "get": {
                "operationId": "rental_p2p_post_read",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/CarPostGetting"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "put": {
                "operationId": "rental_p2p_post_update",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/P2PCarPost"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/P2PCarPost"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "patch": {
                "operationId": "rental_p2p_post_partial_update",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/P2PCarPost"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/P2PCarPost"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "delete": {
                "operationId": "rental_p2p_post_delete",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [],
                "responses": {
                    "204": {
                        "description": ""
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this car post.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/rental/p2p/reservations/": {
            "get": {
                "operationId": "rental_p2p_reservations_list",
                "description": "Peer to Peer Reservations endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/Reservation"
                            }
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "post": {
                "operationId": "rental_p2p_reservations_create",
                "description": "Peer to Peer Reservations endpoint",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Reservation"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Reservation"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "parameters": []
        },
        "/rental/p2p/reservations/{id}/": {
            "get": {
                "operationId": "rental_p2p_reservations_read",
                "description": "Peer to Peer Reservations endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Reservation"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "delete": {
                "operationId": "rental_p2p_reservations_delete",
                "description": "Peer to Peer Reservations endpoint",
                "parameters": [],
                "responses": {
                    "204": {
                        "description": ""
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ]
        },
        "/rental/premium/post/": {
            "get": {
                "operationId": "rental_premium_post_list",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/CarPostGetting"
                            }
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "post": {
                "operationId": "rental_premium_post_create",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/PREMIUMCarPost"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/PREMIUMCarPost"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "parameters": []
        },
        "/rental/premium/post/{id}/": {
            "get": {
                "operationId": "rental_premium_post_read",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/CarPostGetting"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "put": {
                "operationId": "rental_premium_post_update",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/PREMIUMCarPost"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/PREMIUMCarPost"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "patch": {
                "operationId": "rental_premium_post_partial_update",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/PREMIUMCarPost"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/PREMIUMCarPost"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "delete": {
                "operationId": "rental_premium_post_delete",
                "description": "ViewSet to handling car post endpoints.",
                "parameters": [],
                "responses": {
                    "204": {
                        "description": ""
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this car post.",
                    "required": true,
                    "type": "integer"
                }
            ]
        },
        "/rental/premium/reservations/": {
            "get": {
                "operationId": "rental_premium_reservations_list",
                "description": "PREMIUM Reservations endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/Reservation"
                            }
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "post": {
                "operationId": "rental_premium_reservations_create",
                "description": "PREMIUM Reservations endpoint",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Reservation"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Reservation"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "parameters": []
        },
        "/rental/premium/reservations/{id}/": {
            "get": {
                "operationId": "rental_premium_reservations_read",
                "description": "PREMIUM Reservations endpoint",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Reservation"
                        }
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "delete": {
                "operationId": "rental_premium_reservations_delete",
                "description": "PREMIUM Reservations endpoint",
                "parameters": [],
                "responses": {
                    "204": {
                        "description": ""
                    }
                },
                "tags": [
                    "rental"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ]
        },
        "/token/login/": {
            "post": {
                "operationId": "token_login_create",
                "description": "Use this endpoint to obtain user authentication token.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/TokenCreate"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/TokenCreate"
                        }
                    }
                },
                "tags": [
                    "token"
                ]
            },
            "parameters": []
        },
        "/token/logout/": {
            "post": {
                "operationId": "token_logout_create",
                "description": "Use this endpoint to logout user (remove user authentication token).",
                "parameters": [],
                "responses": {
                    "201": {
                        "description": ""
                    }
                },
                "tags": [
                    "token"
                ]
            },
            "parameters": []
        },
        "/users/": {
            "get": {
                "operationId": "users_list",
                "description": "",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/User"
                            }
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "post": {
                "operationId": "users_create",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/UserCreatePasswordRetype"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/UserCreatePasswordRetype"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/activation/": {
            "post": {
                "operationId": "users_activation",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Activation"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Activation"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/me/": {
            "get": {
                "operationId": "users_me_read",
                "description": "",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/User"
                            }
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "put": {
                "operationId": "users_me_update",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "patch": {
                "operationId": "users_me_partial_update",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "delete": {
                "operationId": "users_me_delete",
                "description": "",
                "parameters": [],
                "responses": {
                    "204": {
                        "description": ""
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/me/cars/": {
            "get": {
                "operationId": "users_me_cars_list",
                "description": "Listing cars that an user has.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/MyCarsGetting"
                            }
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/me/checkings": {
            "get": {
                "operationId": "users_me_checkings_read",
                "description": "",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/MyCheckings"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/me/profile_data": {
            "get": {
                "operationId": "users_me_profile_data_read",
                "description": "This class defines all the non required files in the user model.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/UserGetProfile"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "put": {
                "operationId": "users_me_profile_data_update",
                "description": "This class defines all the non required files in the user model.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/UserProfile"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/UserProfile"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "patch": {
                "operationId": "users_me_profile_data_partial_update",
                "description": "This class defines all the non required files in the user model.",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/UserProfile"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/UserProfile"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/resend_activation/": {
            "post": {
                "operationId": "users_resend_activation",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/SendEmailReset"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/SendEmailReset"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/reset_email/": {
            "post": {
                "operationId": "users_reset_username",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/SendEmailReset"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/SendEmailReset"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/reset_email_confirm/": {
            "post": {
                "operationId": "users_reset_username_confirm",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/UsernameResetConfirm"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/UsernameResetConfirm"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/reset_password/": {
            "post": {
                "operationId": "users_reset_password",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/SendEmailReset"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/SendEmailReset"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/reset_password_confirm/": {
            "post": {
                "operationId": "users_reset_password_confirm",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/PasswordResetConfirm"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/PasswordResetConfirm"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/set_email/": {
            "post": {
                "operationId": "users_set_username",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/SetUsername"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/SetUsername"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/set_password/": {
            "post": {
                "operationId": "users_set_password",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/SetPassword"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/SetPassword"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": []
        },
        "/users/{id}/": {
            "get": {
                "operationId": "users_read",
                "description": "",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "put": {
                "operationId": "users_update",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "patch": {
                "operationId": "users_partial_update",
                "description": "",
                "parameters": [
                    {
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/User"
                        }
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "delete": {
                "operationId": "users_delete",
                "description": "",
                "parameters": [],
                "responses": {
                    "204": {
                        "description": ""
                    }
                },
                "tags": [
                    "users"
                ]
            },
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "description": "A unique integer value identifying this user.",
                    "required": true,
                    "type": "integer"
                }
            ]
        }
    },
    "definitions": {
        "Brand": {
            "required": [
                "name"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "name": {
                    "title": "Brand",
                    "description": "The Brand of the car",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                }
            }
        },
        "CarModel": {
            "required": [
                "name"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "brand": {
                    "title": "Brand",
                    "type": "string",
                    "readOnly": true
                },
                "name": {
                    "title": "Model Name",
                    "description": "Name of the model",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                }
            }
        },
        "ModelsOfABrands": {
            "type": "object",
            "properties": {
                "models": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/CarModel"
                    },
                    "readOnly": true
                }
            }
        },
        "Address": {
            "title": "Address",
            "required": [
                "zip_code",
                "address_line_1",
                "province"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "related_to": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "readOnly": true,
                    "uniqueItems": true
                },
                "zip_code": {
                    "title": "ZIP",
                    "description": "Number the Postal location",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "address_line_1": {
                    "title": "Address",
                    "description": "Street and number",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "address_line_2": {
                    "title": "Address extra information",
                    "description": "Plant number, department and others",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1,
                    "x-nullable": true
                },
                "province": {
                    "title": "Province",
                    "description": "The province of the address",
                    "type": "integer"
                }
            }
        },
        "CarReservations": {
            "required": [
                "start_date",
                "end_date"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "start_date": {
                    "title": "Start date",
                    "description": "Start of the rent",
                    "type": "string",
                    "format": "date-time"
                },
                "end_date": {
                    "title": "End date",
                    "description": "Finalization of the rent",
                    "type": "string",
                    "format": "date-time"
                }
            }
        },
        "CarGetting": {
            "required": [
                "address",
                "plate",
                "year"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "brand": {
                    "title": "Brand",
                    "type": "string",
                    "readOnly": true
                },
                "model": {
                    "$ref": "#/definitions/CarModel"
                },
                "address": {
                    "$ref": "#/definitions/Address"
                },
                "reservations": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/CarReservations"
                    },
                    "readOnly": true
                },
                "plate": {
                    "title": "Plate number",
                    "description": "A unique identity number of each car",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "year": {
                    "title": "Year of manufacture",
                    "description": "The year on that the car was built",
                    "type": "integer",
                    "maximum": 2100,
                    "minimum": 1990
                },
                "transmission": {
                    "title": "The car transmission",
                    "description": "'1':other '2':manual '3':auto",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3
                    ]
                },
                "doors": {
                    "title": "Number of doors",
                    "description": "1,2,3,4 or 5",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3,
                        4,
                        5
                    ]
                },
                "kilometers": {
                    "title": "Kilometers rolled",
                    "description": "The rolled distance in kilometers",
                    "type": "integer",
                    "maximum": 2147483647,
                    "minimum": 0,
                    "x-nullable": true
                },
                "fuel_type": {
                    "title": "Fuel type",
                    "description": "'1':oil '2':diesel '3':hybrid\n                                    '4':electric '5':other",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3,
                        4,
                        5
                    ],
                    "x-nullable": true
                },
                "manual_check": {
                    "title": "Manual check",
                    "description": "Manual verification by an ATUA checker",
                    "type": "boolean"
                },
                "rented": {
                    "title": "Rented",
                    "description": "Actual status of the car about the rent",
                    "type": "boolean",
                    "readOnly": true
                },
                "car_front": {
                    "title": "Car Front",
                    "description": "Picture of the front of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_right": {
                    "title": "Car Right",
                    "description": "Picture of the right of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_left": {
                    "title": "Car Left",
                    "description": "Picture of the left of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_back": {
                    "title": "Car Back",
                    "description": "Picture of the back of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "mechanical_check_photo": {
                    "title": "Car mechanical checking",
                    "description": "From argentinian check 'VTV'",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "insurance_photo": {
                    "title": "Car Insurance",
                    "description": "Picture of the car insurance",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "driver_card": {
                    "title": "Driver Card",
                    "description": "Driver Card Snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "extra_features": {
                    "description": "Features of the car added by the owner",
                    "type": "array",
                    "items": {
                        "title": "Feature",
                        "description": "Feature of the car added by the owner",
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "x-nullable": true
                    },
                    "x-nullable": true
                },
                "last_documentation_update": {
                    "title": "Last documentation update",
                    "type": "string",
                    "format": "date-time",
                    "readOnly": true
                }
            }
        },
        "CarCreating": {
            "required": [
                "plate",
                "year"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "plate": {
                    "title": "Plate number",
                    "description": "A unique identity number of each car",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "year": {
                    "title": "Year of manufacture",
                    "description": "The year on that the car was built",
                    "type": "integer",
                    "maximum": 2100,
                    "minimum": 1990
                },
                "model": {
                    "title": "Model",
                    "description": "The Model of the car",
                    "type": "integer",
                    "x-nullable": true
                },
                "brand": {
                    "title": "Brand",
                    "description": "The Brand of the car",
                    "type": "integer",
                    "x-nullable": true
                }
            }
        },
        "CarGeneral": {
            "required": [
                "plate",
                "year",
                "owner"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "plate": {
                    "title": "Plate number",
                    "description": "A unique identity number of each car",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "year": {
                    "title": "Year of manufacture",
                    "description": "The year on that the car was built",
                    "type": "integer",
                    "maximum": 2100,
                    "minimum": 1990
                },
                "transmission": {
                    "title": "The car transmission",
                    "description": "'1':other '2':manual '3':auto",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3
                    ]
                },
                "doors": {
                    "title": "Number of doors",
                    "description": "1,2,3,4 or 5",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3,
                        4,
                        5
                    ]
                },
                "kilometers": {
                    "title": "Kilometers rolled",
                    "description": "The rolled distance in kilometers",
                    "type": "integer",
                    "maximum": 2147483647,
                    "minimum": 0,
                    "x-nullable": true
                },
                "fuel_type": {
                    "title": "Fuel type",
                    "description": "'1':oil '2':diesel '3':hybrid\n                                    '4':electric '5':other",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3,
                        4,
                        5
                    ],
                    "x-nullable": true
                },
                "manual_check": {
                    "title": "Manual check",
                    "description": "Manual verification by an ATUA checker",
                    "type": "boolean"
                },
                "rented": {
                    "title": "Rented",
                    "description": "Actual status of the car about the rent",
                    "type": "boolean",
                    "readOnly": true
                },
                "car_front": {
                    "title": "Car Front",
                    "description": "Picture of the front of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_right": {
                    "title": "Car Right",
                    "description": "Picture of the right of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_left": {
                    "title": "Car Left",
                    "description": "Picture of the left of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_back": {
                    "title": "Car Back",
                    "description": "Picture of the back of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "mechanical_check_photo": {
                    "title": "Car mechanical checking",
                    "description": "From argentinian check 'VTV'",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "insurance_photo": {
                    "title": "Car Insurance",
                    "description": "Picture of the car insurance",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "driver_card": {
                    "title": "Driver Card",
                    "description": "Driver Card Snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "extra_features": {
                    "description": "Features of the car added by the owner",
                    "type": "array",
                    "items": {
                        "title": "Feature",
                        "description": "Feature of the car added by the owner",
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "x-nullable": true
                    },
                    "x-nullable": true
                },
                "last_documentation_update": {
                    "title": "Last documentation update",
                    "type": "string",
                    "format": "date-time",
                    "readOnly": true
                },
                "owner": {
                    "title": "Owner",
                    "description": "The user owner of the Car",
                    "type": "integer"
                },
                "brand": {
                    "title": "Brand",
                    "description": "The Brand of the car",
                    "type": "integer",
                    "x-nullable": true
                },
                "model": {
                    "title": "Model",
                    "description": "The Model of the car",
                    "type": "integer",
                    "x-nullable": true
                },
                "address": {
                    "title": "Address",
                    "description": "The address of car owner",
                    "type": "integer",
                    "x-nullable": true
                }
            }
        },
        "BranchOffice": {
            "required": [
                "name"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "address": {
                    "title": "Address",
                    "type": "string",
                    "readOnly": true
                },
                "name": {
                    "title": "Name",
                    "description": "Name of the Branch Office",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "local_currency_rate": {
                    "title": "L.C.R.",
                    "type": "number"
                },
                "phone": {
                    "title": "Phone",
                    "description": "Phone contact",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1,
                    "x-nullable": true
                },
                "email": {
                    "title": "Email",
                    "description": "Email contact",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1,
                    "x-nullable": true
                }
            }
        },
        "Country": {
            "required": [
                "name",
                "aka"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "name": {
                    "title": "Country",
                    "description": "Name of the Country",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "aka": {
                    "title": "A.K.A.",
                    "description": "'Also know as'. Alias of a country",
                    "type": "string",
                    "maxLength": 20,
                    "minLength": 1
                }
            }
        },
        "Province": {
            "required": [
                "name"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "country": {
                    "title": "Country",
                    "type": "string",
                    "readOnly": true
                },
                "name": {
                    "title": "Province",
                    "description": "Name of the province",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                }
            }
        },
        "ProvincesOfACountry": {
            "type": "object",
            "properties": {
                "provinces": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Province"
                    },
                    "readOnly": true
                }
            }
        },
        "PricePerYear": {
            "required": [
                "year",
                "price"
            ],
            "type": "object",
            "properties": {
                "year": {
                    "title": "Year of manufacture",
                    "description": "The year on that the car was built",
                    "type": "integer",
                    "maximum": 2200,
                    "minimum": 1990
                },
                "price": {
                    "title": "Price",
                    "type": "number",
                    "format": "decimal",
                    "minimum": 0
                }
            }
        },
        "CarModelPricesPerYear": {
            "type": "object",
            "properties": {
                "prices": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/PricePerYear"
                    },
                    "readOnly": true
                }
            }
        },
        "Reservation": {
            "required": [
                "paid_amount",
                "start_date",
                "end_date",
                "client",
                "post"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "paid_amount": {
                    "title": "Paid Amount",
                    "description": "Paid full or only an advanced",
                    "type": "integer",
                    "maximum": 9223372036854775807,
                    "minimum": 0
                },
                "paid_complete": {
                    "title": "Paid complete",
                    "description": "Is complete paid/advanced paid",
                    "type": "boolean",
                    "readOnly": true
                },
                "start_date": {
                    "title": "Start date",
                    "description": "Start of the rent",
                    "type": "string",
                    "format": "date-time"
                },
                "end_date": {
                    "title": "End date",
                    "description": "Finalization of the rent",
                    "type": "string",
                    "format": "date-time"
                },
                "delivered": {
                    "title": "Delivered",
                    "description": "Is Delivered to the client",
                    "type": "string",
                    "format": "date-time",
                    "x-nullable": true
                },
                "returned": {
                    "title": "Returned",
                    "description": "If the car is returned",
                    "type": "string",
                    "format": "date-time",
                    "x-nullable": true
                },
                "client": {
                    "title": "Client",
                    "description": "User that is reserving the car",
                    "type": "integer"
                },
                "post": {
                    "title": "Post",
                    "description": "Publication of the car",
                    "type": "integer"
                }
            }
        },
        "CarPostGetting": {
            "required": [
                "car",
                "price"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "car": {
                    "$ref": "#/definitions/CarGetting"
                },
                "branch_office": {
                    "title": "Branch office",
                    "type": "string",
                    "readOnly": true
                },
                "available": {
                    "title": "Available",
                    "type": "string",
                    "readOnly": true,
                    "minLength": 1
                },
                "reservations": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Reservation"
                    },
                    "readOnly": true
                },
                "price": {
                    "title": "Price",
                    "description": "Price per day",
                    "type": "integer",
                    "maximum": 9223372036854775807,
                    "minimum": 0
                },
                "post_date": {
                    "title": "Post date",
                    "description": "Posted date",
                    "type": "string",
                    "format": "date-time",
                    "readOnly": true
                },
                "available_since": {
                    "title": "Available Since",
                    "description": "When the car is available",
                    "type": "string",
                    "format": "date-time"
                },
                "available_until": {
                    "title": "Available Until",
                    "description": "When the car is not yet available",
                    "type": "string",
                    "format": "date-time",
                    "x-nullable": true
                },
                "premium": {
                    "title": "Is Premium",
                    "description": "Is Premim? true/false",
                    "type": "boolean"
                },
                "message": {
                    "title": "Message",
                    "description": "Text body of the post",
                    "type": "string",
                    "minLength": 1,
                    "x-nullable": true
                }
            }
        },
        "P2PCarPost": {
            "required": [
                "price",
                "car"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "price": {
                    "title": "Price",
                    "description": "Price per day",
                    "type": "integer",
                    "maximum": 9223372036854775807,
                    "minimum": 0
                },
                "post_date": {
                    "title": "Post date",
                    "description": "Posted date",
                    "type": "string",
                    "format": "date-time",
                    "readOnly": true
                },
                "available_since": {
                    "title": "Available Since",
                    "description": "When the car is available",
                    "type": "string",
                    "format": "date-time"
                },
                "available_until": {
                    "title": "Available Until",
                    "description": "When the car is not yet available",
                    "type": "string",
                    "format": "date-time",
                    "x-nullable": true
                },
                "message": {
                    "title": "Message",
                    "description": "Text body of the post",
                    "type": "string",
                    "minLength": 1,
                    "x-nullable": true
                },
                "car": {
                    "title": "Car",
                    "description": "The car about that publication is",
                    "type": "integer"
                },
                "branch_office": {
                    "title": "Branch Office",
                    "description": "Office where the car is registred",
                    "type": "integer",
                    "x-nullable": true
                }
            }
        },
        "PREMIUMCarPost": {
            "required": [
                "price",
                "car"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "price": {
                    "title": "Price",
                    "description": "Price per day",
                    "type": "integer",
                    "maximum": 9223372036854775807,
                    "minimum": 0
                },
                "post_date": {
                    "title": "Post date",
                    "description": "Posted date",
                    "type": "string",
                    "format": "date-time",
                    "readOnly": true
                },
                "available_since": {
                    "title": "Available Since",
                    "description": "When the car is available",
                    "type": "string",
                    "format": "date-time"
                },
                "available_until": {
                    "title": "Available Until",
                    "description": "When the car is not yet available",
                    "type": "string",
                    "format": "date-time",
                    "x-nullable": true
                },
                "message": {
                    "title": "Message",
                    "description": "Text body of the post",
                    "type": "string",
                    "minLength": 1,
                    "x-nullable": true
                },
                "car": {
                    "title": "Car",
                    "description": "The car about that publication is",
                    "type": "integer"
                },
                "branch_office": {
                    "title": "Branch Office",
                    "description": "Office where the car is registred",
                    "type": "integer",
                    "x-nullable": true
                }
            }
        },
        "TokenCreate": {
            "type": "object",
            "properties": {
                "password": {
                    "title": "Password",
                    "type": "string",
                    "minLength": 1
                },
                "email": {
                    "title": "Email",
                    "type": "string",
                    "minLength": 1
                }
            }
        },
        "User": {
            "required": [
                "first_name",
                "last_name",
                "phone",
                "password"
            ],
            "type": "object",
            "properties": {
                "first_name": {
                    "title": "First_name",
                    "description": "The user's first name",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "last_name": {
                    "title": "Last_name",
                    "description": "The user's last name",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "phone": {
                    "title": "Phone",
                    "description": "The user's phone number",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "password": {
                    "title": "Password",
                    "type": "string",
                    "maxLength": 128,
                    "minLength": 1
                },
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "email": {
                    "title": "Email",
                    "description": "The user's email address",
                    "type": "string",
                    "format": "email",
                    "readOnly": true,
                    "minLength": 1
                }
            }
        },
        "UserCreatePasswordRetype": {
            "required": [
                "first_name",
                "last_name",
                "phone",
                "password",
                "email",
                "re_password"
            ],
            "type": "object",
            "properties": {
                "first_name": {
                    "title": "First_name",
                    "description": "The user's first name",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "last_name": {
                    "title": "Last_name",
                    "description": "The user's last name",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "phone": {
                    "title": "Phone",
                    "description": "The user's phone number",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "password": {
                    "title": "Password",
                    "type": "string",
                    "minLength": 1
                },
                "email": {
                    "title": "Email",
                    "description": "The user's email address",
                    "type": "string",
                    "format": "email",
                    "maxLength": 255,
                    "minLength": 1
                },
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "re_password": {
                    "title": "Re password",
                    "type": "string",
                    "minLength": 1
                }
            }
        },
        "Activation": {
            "required": [
                "uid",
                "token"
            ],
            "type": "object",
            "properties": {
                "uid": {
                    "title": "Uid",
                    "type": "string",
                    "minLength": 1
                },
                "token": {
                    "title": "Token",
                    "type": "string",
                    "minLength": 1
                }
            }
        },
        "MyCarsGetting": {
            "required": [
                "address",
                "maxRentalPrice",
                "minRentalPrice",
                "plate",
                "year"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "brand": {
                    "title": "Brand",
                    "type": "string",
                    "readOnly": true
                },
                "model": {
                    "$ref": "#/definitions/CarModel"
                },
                "address": {
                    "$ref": "#/definitions/Address"
                },
                "reservations": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/CarReservations"
                    },
                    "readOnly": true
                },
                "maxRentalPrice": {
                    "title": "Maxrentalprice",
                    "type": "number",
                    "format": "decimal",
                    "minimum": 0
                },
                "minRentalPrice": {
                    "title": "Minrentalprice",
                    "type": "number",
                    "format": "decimal",
                    "minimum": 0
                },
                "plate": {
                    "title": "Plate number",
                    "description": "A unique identity number of each car",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "year": {
                    "title": "Year of manufacture",
                    "description": "The year on that the car was built",
                    "type": "integer",
                    "maximum": 2100,
                    "minimum": 1990
                },
                "transmission": {
                    "title": "The car transmission",
                    "description": "'1':other '2':manual '3':auto",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3
                    ]
                },
                "doors": {
                    "title": "Number of doors",
                    "description": "1,2,3,4 or 5",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3,
                        4,
                        5
                    ]
                },
                "kilometers": {
                    "title": "Kilometers rolled",
                    "description": "The rolled distance in kilometers",
                    "type": "integer",
                    "maximum": 2147483647,
                    "minimum": 0,
                    "x-nullable": true
                },
                "fuel_type": {
                    "title": "Fuel type",
                    "description": "'1':oil '2':diesel '3':hybrid\n                                    '4':electric '5':other",
                    "type": "integer",
                    "enum": [
                        1,
                        2,
                        3,
                        4,
                        5
                    ],
                    "x-nullable": true
                },
                "manual_check": {
                    "title": "Manual check",
                    "description": "Manual verification by an ATUA checker",
                    "type": "boolean"
                },
                "rented": {
                    "title": "Rented",
                    "description": "Actual status of the car about the rent",
                    "type": "boolean",
                    "readOnly": true
                },
                "car_front": {
                    "title": "Car Front",
                    "description": "Picture of the front of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_right": {
                    "title": "Car Right",
                    "description": "Picture of the right of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_left": {
                    "title": "Car Left",
                    "description": "Picture of the left of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "car_back": {
                    "title": "Car Back",
                    "description": "Picture of the back of the car",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "mechanical_check_photo": {
                    "title": "Car mechanical checking",
                    "description": "From argentinian check 'VTV'",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "insurance_photo": {
                    "title": "Car Insurance",
                    "description": "Picture of the car insurance",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "driver_card": {
                    "title": "Driver Card",
                    "description": "Driver Card Snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "extra_features": {
                    "description": "Features of the car added by the owner",
                    "type": "array",
                    "items": {
                        "title": "Feature",
                        "description": "Feature of the car added by the owner",
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "x-nullable": true
                    },
                    "x-nullable": true
                },
                "last_documentation_update": {
                    "title": "Last documentation update",
                    "type": "string",
                    "format": "date-time",
                    "readOnly": true
                }
            }
        },
        "UserPapersChecking": {
            "type": "object",
            "properties": {
                "status": {
                    "title": "Status",
                    "type": "integer",
                    "readOnly": true
                },
                "reason": {
                    "title": "Failure Reason",
                    "description": "Reason provided when the check fail",
                    "type": "string",
                    "readOnly": true,
                    "minLength": 1
                },
                "checked_at": {
                    "title": "Checked at",
                    "type": "string",
                    "format": "date-time",
                    "readOnly": true
                }
            }
        },
        "MyCheckings": {
            "type": "object",
            "properties": {
                "papers": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/UserPapersChecking"
                    },
                    "readOnly": true
                }
            }
        },
        "ProvinceOfAddress": {
            "title": "Province",
            "required": [
                "name"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "country": {
                    "title": "Country",
                    "type": "string",
                    "readOnly": true
                },
                "name": {
                    "title": "Province",
                    "description": "Name of the province",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                }
            }
        },
        "AddressProfile": {
            "title": "Address",
            "required": [
                "zip_code",
                "address_line_1"
            ],
            "type": "object",
            "properties": {
                "id": {
                    "title": "ID",
                    "type": "integer",
                    "readOnly": true
                },
                "province": {
                    "$ref": "#/definitions/ProvinceOfAddress"
                },
                "zip_code": {
                    "title": "ZIP",
                    "description": "Number the Postal location",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "address_line_1": {
                    "title": "Address",
                    "description": "Street and number",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1
                },
                "address_line_2": {
                    "title": "Address extra information",
                    "description": "Plant number, department and others",
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 1,
                    "x-nullable": true
                }
            }
        },
        "UserGetProfile": {
            "type": "object",
            "properties": {
                "address": {
                    "$ref": "#/definitions/AddressProfile"
                },
                "passport": {
                    "title": "Passport",
                    "description": "International id number",
                    "type": "string",
                    "maxLength": 255
                },
                "dni": {
                    "title": "DNI",
                    "description": "Argentinian id number",
                    "type": "integer",
                    "maximum": 2147483647,
                    "minimum": 0,
                    "x-nullable": true
                },
                "birth_date": {
                    "title": "Birth Date",
                    "description": "Date of birth",
                    "type": "string",
                    "format": "date",
                    "x-nullable": true
                },
                "license_expiration": {
                    "title": "Licence expiration",
                    "description": "Expiration date of the licence",
                    "type": "string",
                    "format": "date",
                    "x-nullable": true
                },
                "passport_front": {
                    "title": "Pasport Front",
                    "description": "Passport frontal snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "passport_back": {
                    "title": "Pasport back",
                    "description": "Passport back snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "dni_front": {
                    "title": "DNI Front",
                    "description": "DNI frontal snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "dni_back": {
                    "title": "DNI back",
                    "description": "DNI back snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "driver_license_front": {
                    "title": "Driver Licence Front",
                    "description": "Driver lic. frontal snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "driver_license_back": {
                    "title": "Driver Licence Back",
                    "description": "Driver lic. back snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                }
            }
        },
        "UserProfile": {
            "type": "object",
            "properties": {
                "address": {
                    "title": "Address",
                    "type": "integer",
                    "x-nullable": true
                },
                "passport": {
                    "title": "Passport",
                    "description": "International id number",
                    "type": "string",
                    "maxLength": 255
                },
                "dni": {
                    "title": "DNI",
                    "description": "Argentinian id number",
                    "type": "integer",
                    "maximum": 2147483647,
                    "minimum": 0,
                    "x-nullable": true
                },
                "birth_date": {
                    "title": "Birth Date",
                    "description": "Date of birth",
                    "type": "string",
                    "format": "date",
                    "x-nullable": true
                },
                "license_expiration": {
                    "title": "Licence expiration",
                    "description": "Expiration date of the licence",
                    "type": "string",
                    "format": "date",
                    "x-nullable": true
                },
                "passport_front": {
                    "title": "Pasport Front",
                    "description": "Passport frontal snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "passport_back": {
                    "title": "Pasport back",
                    "description": "Passport back snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "dni_front": {
                    "title": "DNI Front",
                    "description": "DNI frontal snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "dni_back": {
                    "title": "DNI back",
                    "description": "DNI back snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "driver_license_front": {
                    "title": "Driver Licence Front",
                    "description": "Driver lic. frontal snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                },
                "driver_license_back": {
                    "title": "Driver Licence Back",
                    "description": "Driver lic. back snapshot",
                    "type": "string",
                    "readOnly": true,
                    "x-nullable": true,
                    "format": "uri"
                }
            }
        },
        "SendEmailReset": {
            "required": [
                "email"
            ],
            "type": "object",
            "properties": {
                "email": {
                    "title": "Email",
                    "type": "string",
                    "format": "email",
                    "minLength": 1
                }
            }
        },
        "UsernameResetConfirm": {
            "required": [
                "new_email"
            ],
            "type": "object",
            "properties": {
                "new_email": {
                    "title": "Email",
                    "description": "The user's email address",
                    "type": "string",
                    "format": "email",
                    "maxLength": 255,
                    "minLength": 1
                }
            }
        },
        "PasswordResetConfirm": {
            "required": [
                "uid",
                "token",
                "new_password"
            ],
            "type": "object",
            "properties": {
                "uid": {
                    "title": "Uid",
                    "type": "string",
                    "minLength": 1
                },
                "token": {
                    "title": "Token",
                    "type": "string",
                    "minLength": 1
                },
                "new_password": {
                    "title": "New password",
                    "type": "string",
                    "minLength": 1
                }
            }
        },
        "SetUsername": {
            "required": [
                "new_email"
            ],
            "type": "object",
            "properties": {
                "new_email": {
                    "title": "Email",
                    "description": "The user's email address",
                    "type": "string",
                    "format": "email",
                    "maxLength": 255,
                    "minLength": 1
                }
            }
        },
        "SetPassword": {
            "required": [
                "new_password",
                "current_password"
            ],
            "type": "object",
            "properties": {
                "new_password": {
                    "title": "New password",
                    "type": "string",
                    "minLength": 1
                },
                "current_password": {
                    "title": "Current password",
                    "type": "string",
                    "minLength": 1
                }
            }
        }
    }
}

lalmeras added a commit to lalmeras/http-prompt that referenced this issue Feb 7, 2021
Current code expect Path object to contain only method/Operation
declaration. Path object may contain $ref, summary, description, servers
and parameters entries.

If available, this entries are default values to apply children
Operation.

This fix drops unused entries ($ref, summary, description, servers) and
merge parameters:
* unicity based on name/in unicity
* Operation value takes precedence

This fix allows to parse spec file attached with httpie#172
@lalmeras
Copy link
Contributor

lalmeras commented Feb 7, 2021

See #188 for a fix proposal. Fix explained on the PR. No error with the attached json file, and completion seems to work as expected.

Notice that PR #154 that is older tries to fix the same problem.

lalmeras added a commit to lalmeras/http-prompt that referenced this issue Feb 7, 2021
Parameter may be a ``{ '$ref': '...' }``. We need to use $ref, name, in
attributes for processing parameter list merging.
lalmeras added a commit to lalmeras/http-prompt that referenced this issue Feb 7, 2021
Path and methods parameters are merged to handle completion.

Merge process is fixed to allow completion when parameters are
configured only at path level.
jkbrzt pushed a commit that referenced this issue Feb 7, 2021
* issue #172: spec/buggy Path/Operation handling

Current code expect Path object to contain only method/Operation
declaration. Path object may contain $ref, summary, description, servers
and parameters entries.

If available, this entries are default values to apply children
Operation.

This fix drops unused entries ($ref, summary, description, servers) and
merge parameters:
* unicity based on name/in unicity
* Operation value takes precedence

This fix allows to parse spec file attached with #172

* issue #172: fix regression for $ref params

Parameter may be a ``{ '$ref': '...' }``. We need to use $ref, name, in
attributes for processing parameter list merging.

* issue #172: added testcase and fix

Path and methods parameters are merged to handle completion.

Merge process is fixed to allow completion when parameters are
configured only at path level.
@lalmeras
Copy link
Contributor

lalmeras commented Feb 7, 2021

PR #188 was merged today and fixes this issue.

@agustin-jimenez Can you confirm the current master fixes your issue ?

@agustin-jimenez
Copy link
Author

agustin-jimenez commented Feb 10, 2021

Sorry I was very busy this week!

Today I'll check this today. Thanks for reply me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants