swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.92k stars 6.03k forks source link

Codegenerator fails on Windows #1623

Closed Stormyy closed 8 years ago

Stormyy commented 8 years ago

Code doens't generate however i can't find a error in my JSON. Any idea what im doing wrong?

Exception in thread "main" java.lang.RuntimeException: Could not generate api file for 'App'
        at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:296)
        at io.swagger.codegen.cmd.Generate.run(Generate.java:188)
        at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: java.lang.IllegalArgumentException: character to be escaped is missing
        at java.util.regex.Matcher.appendReplacement(Unknown Source)
        at java.util.regex.Matcher.replaceAll(Unknown Source)
        at java.lang.String.replaceAll(Unknown Source)
        at io.swagger.codegen.languages.PhpClientCodegen.toPackagePath(PhpClientCodegen.java:124)
        at io.swagger.codegen.languages.PhpClientCodegen.apiFileFolder(PhpClientCodegen.java:212)
        at io.swagger.codegen.DefaultCodegen.apiFilename(DefaultCodegen.java:1612)
        at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:275)
        ... 2 more
fehguy commented 8 years ago

Can you share your spec? Perhaps you have a path param which doesn't match the parameter name?

Stormyy commented 8 years ago

Here is my spec it's a bit long. It passed validation using http://json-schema-validator.herokuapp.com/ with swagger schema

{
    "swagger": "2.0",
    "host": "api.example.com",
    "basePath": "/v1",
    "schemes": [
        "https"
    ],
    "info": {
        "version": "1.4.1",
        "title": "example API",
        "description": "example"
    },
    "tags": [{
        "name": "Public",
        "description": "Public statistics"
    }, {
        "name": "Account",
        "description": "The Account API provides full-fledged account creation and management. Every step of the account creation and email activation can be done through this API the same way it is done through the example website."
    }, {
        "name": "Verification",
        "description": "The Verification API allows complete management and submission of all necessary KYC (Know-Your-Customer) documents, bank accounts or business documents. You can setup your business account and onboard your customers in a matter in minutes"
    }, {
        "name": "App",
        "description": "The App API allows complete management of your App as an businesspartner"
    }, {
        "name": "Quoting",
        "description": "The Quoting API allows you create, send and manage price quotes."
    }, {
        "name": "Trading",
        "description": "The Trading API contains all the calls, necessary for buying or selling bitcoins. Placing and managing orders is all done here."
    }, {
        "name": "Funds",
        "description": "The Funds API allows complete management of the customer funds. Depositing, withdrawing and sending funds to other accounts is all done here. If you need to convert funds from one currency to another - use the Trading API."
    },
    {
        "name": "Utility",
        "description": "The Utility API"
    }],
    "paths": {
        "/app": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "Get selected app",
                "description": "Get selected app.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "App",
                            "type": "object",
                            "properties": {

                            }
                        }
                    }
                }
            }
        },
        "/app/accounts": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "Get app accounts",
                "description": "Max 100 results per request",  
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Limit amount of records. Standard: 100.", 
                        "required": false,
                        "type": "number"
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Offset records",
                        "required": false,
                        "type": "number"
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Get specifc user",
                        "required": false,
                        "type": "string"
                    }

                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Accounts",
                            "type": "object"

                        }

                    }
                }
            }
        },
        "/app/webhook": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "Get app webhooks.",
                "description": "Get app webhooks.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Webhooks",
                            "type": "object",
                            "properties": {

                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "App"
                ],
                "summary": "Webhooks to receive data if something is changed",
                "description": "description",
                "parameters": [
                    {
                        "name": "type",
                        "in": "formData",
                        "description": "Type of webhook",
                        "enum": ["deposit", "verification", "bankaccount"],
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "url",
                        "in": "formData",
                        "description": "Webhook url",
                        "required": false,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "result",
                            "type": "object",
                            "properties": {

                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "App"
                ],
                "summary": "Add app webhook.",
                "description": "Add app webhook.",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Type of webhook",
                        "enum": ["deposit", "verification", "bankaccount"],
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "url",
                        "in": "query",
                        "description": "Webhook url",
                        "required": false,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "result",
                            "type": "object",
                            "properties": {

                            }
                        }
                    }
                }
            }
        },
        "/ticker": {
            "get": {
                "tags": [
                    "Public"
                ],
                "summary": "Get the latest ticker data. The data contains multiple values, which help you understand the current market better",
                "description": "The data shown is taken from the past 24 hours till now.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Ticker",
                            "type": "object",
                            "properties": {
                                "timestamp": {
                                    "type": "number",
                                    "description": "The Epoch time (01-01-1970 till now) measured in miliseconds."
                                },
                                "low": {
                                    "type": "string",
                                    "description": "The lowest price at which bitcoins were bought."
                                },
                                "high": {
                                    "type": "string",
                                    "description": "The highest price at which bitcoins were sold."
                                },
                                "ask": {
                                    "type": "string",
                                    "description": "The lowest price at which bitcoins can be bought at the moment."
                                },
                                "bid": {
                                    "type": "string",
                                    "description": "The highest price at which bitcoins can be sold at the moment."
                                },
                                "previous": {
                                    "type": "string",
                                    "description": "The price at which bitcoins were traded 24 hours ago."
                                },
                                "last": {
                                    "type": "string",
                                    "description": "The price at which bitcoins can be traded at the moment."
                                },
                                "volume": {
                                    "type": "string",
                                    "description": "The amount of bitcoins traded."
                                }
                            }
                        }
                    }
                }
            }
        },
        "/exchangeRateHistory": {
            "get": {
                "tags": [
                    "Public"
                ],
                "summary": "Get historical data of the exchange rate",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "historicRates",
                            "type": "object",
                            "properties": {
                                "rates": {
                                    "type": "array",
                                    "description": "All historical exchange rates grouped by timestamp.",
                                    "items": {
                                        "title": "timestamp",
                                        "type": "number"
                                    }
                                }
                            },
                            "example":[
                                      [
                                        1436848321000,
                                        0
                                      ],
                                      [
                                        1436848383000,
                                        0
                                      ]
                                    ]
                        }
                    }
                }
            }
        },
        "/orderbook": {
            "get": {
                "tags": [
                    "Public"
                ],
                "summary": "Get the all the bids and asks from the orderbook",
                "description": "",
                "parameters": [{
                    "name": "group",
                    "in": "query",
                    "description": "Group orders for the same price. Possible values are '0' (don't group) or '1' (group).",
                    "enum": ["1", "0"],
                    "required": false,
                    "type": "string"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Orderbook",
                            "type": "object",
                            "properties": {
                                "timestamp": {
                                    "type": "number"
                                },
                                "bids": {
                                    "type": "array",
                                    "description": "All open orders for buying bitcoins at the time.",
                                    "items": {
                                        "title": "bid",
                                        "type": "array",
                                        "items": {
                                            "type": "number",
                                            "format": "double"
                                        }
                                    }
                                },
                                "asks": {
                                    "type": "array",
                                    "description": "All open orders for selling bitcoins at the time.",
                                    "items": {
                                        "title": "bid",
                                        "type": "array",
                                        "items": {
                                            "type": "number",
                                            "format": "double"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/transactions": {
            "get": {
                "tags": [
                    "Public"
                ],
                "summary": "Get all completed trades.",
                "description": "",
                "parameters": [{
                    "name": "since",
                    "in": "query",
                    "description": "Show only trades with a higher than this transaction ID.",
                    "required": false,
                    "type": "number"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Transactions",
                            "type": "array",
                            "items": {
                                "title": "Transaction",
                                "type": "object",
                                "properties": {
                                    "date": {
                                        "type": "number",
                                        "description": "Unix epoch timestamp of the moment in which the transaction was processed."
                                    },
                                    "tid": {
                                        "type": "number",
                                        "description": "Unique transaction ID used for identifying the transactions."
                                    },
                                    "price": {
                                        "type": "number",
                                        "format": "double",
                                        "description": "The price at which the trade was done."
                                    },
                                    "amount": {
                                        "type": "number",
                                        "format": "double",
                                        "description": "Amount of bitcoins traded."
                                    }
                                }
                            },
                            "example":    [{
                                            "date": 0,
                                            "tid": 0,
                                            "price": 0,
                                            "amount": 0.00
                                            }]
                        }
                    }
                }
            }
        },
        "/orders/limited": {
            "post": {
                "tags": [
                    "Trading"
                ],
                "summary": "Create a new limited order with the desired properties.",
                "description": "In order to place a regular <b>market order</b>, you should specify very high price when buying or very low price when selling. <br><br><i>Example:<br> buy-> (type = bid, amount = 1, price = 10000)<br>sell-> (type = ask, amount = 1, price = 0.01)</i><br><br> This will automatically execute your order with the best price currently offered on the market.",
                "parameters": [{
                    "$ref": "#/parameters/type"
                }, {
                    "$ref": "#/parameters/amount"
                }, {
                    "$ref": "#/parameters/price"
                },{
                    "$ref": "#/parameters/timelimit"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Result",
                            "type": "object",
                            "properties": {
                                "orderID": {
                                    "type": "number",
                                    "description": "Identification number unique for every order."
                                }
                            },
                            "example": {
                                "orderID": 0
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Trading"
                ],
                "summary": "Retrieve all your opened limited orders",
                "description": "Retreives a list of all opened when no orderID is specified.",
                "parameters": [{
                    "name": "orderID",
                    "in": "query",
                    "description": "The ID of the order, which information you want to obtain.",
                    "required": false,
                    "type": "number"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Orders",
                            "type": "array",
                            "items": {
                                "title": "limitedOrder",
                                "type": "object",
                                "properties": {
                                    "orderID": {
                                        "type": "number",
                                        "description": "Identification number unique for every order."
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "The type of order - 'bid' or 'ask'."
                                    },
                                    "amount": {
                                        "type": "string",
                                        "description": "Amount of bitcoins, which were bought or sold."
                                    },
                                    "remainingAmount": {
                                        "type": "string",
                                        "description": "Amount of bitcoins, which are waiting to be bought or sold."
                                    },
                                    "price": {
                                        "type": "string",
                                        "description": "Price at which the bitcoins were bought or sold."
                                    },
                                    "isOpen": {
                                        "type": "boolean",
                                        "description": "Indicator showing if the order open or is already completed."
                                    },
                                    "created": {
                                        "type": "number",
                                        "description": "Unix epoch timestamp of the moment at which the order was created."
                                    }
                                }
                            },
                            "example": [
                                 {
                                    "orderID": 0,
                                    "type": "string",
                                    "amount": "0",
                                    "remainingAmount": "0",
                                    "price": "0",
                                    "isOpen": false,
                                    "created": 0
                                }
                            ]
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Trading"
                ],
                "summary": "Delete a limited order, based on the provided orderID",
                "description": "",
                "parameters": [{
                    "name": "orderID",
                    "in": "query",
                    "description": "The ID of the order to be removed",
                    "required": true,
                    "type": "number"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Result",
                            "type": "object",
                            "properties": {
                                "result": {
                                    "type": "string",
                                    "description": "String indicator showing the result of the removal request."
                                }
                            },
                            "example": {
                                "result": "string"
                            }
                        }
                    }
                }
            }
        },   
        "/trade/fee": {
            "get": {
                "tags": [
                    "Trading"
                ],
                "summary": "Get tradingfee percentage",
                "description": "Get tradingfee percentage.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Fee",
                            "type": "object",
                            "properties": {

                            }
                        }
                    }
                }
            }
        }, 
        "/trades": {
            "get": {
                "tags": [
                    "Trading"
                ],
                "parameters": [{
                    "name": "count",
                    "in": "query",
                    "description": "The maximum number of trades to show",
                    "required": false,
                    "type": "number"
                }],
                "summary": "Return the executed trades on your orders. Newest first",
                "description": "If the count parameter is missing, returns the latest (up to 500) trades.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Trades",
                            "type": "array",
                            "items": {
                                "title": "trade",
                                "type": "object",
                                "properties": {
                                    "transactionId": {
                                        "type": "string",
                                        "description": "Unique transaction ID used for identifying the transactions."
                                    },
                                    "time": {
                                        "type": "number",
                                        "description": "Unix epoch timestamp of the moment in which the transaction was processed."
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "The type of trade - 'buy' or 'sell'"
                                    },
                                    "price": {
                                        "type": "string",
                                        "description": "The price at which the trade was done."
                                    },
                                    "volume": {
                                        "type": "string",
                                        "description": "The amount of bitcoins traded."
                                    },
                                    "order": {
                                        "type": "string",
                                        "description": "Identification number unique for every order."

                                    },
                                    "fee": {
                                        "type": "string",
                                        "description": "The amount of fees in bitcoins taken for this trade in euros."
                                    }
                                }

                            },
                            "example":{
                                "transactionId": "0",
                                "time": 0,
                                "type": "string",
                                "price": "0",
                                "volume": "0",
                                "order": "0",
                                "fee": "0"
                            }
                        }
                    }
                }
            }
        },
        "/account": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Obtain information about the user account",
                "description": "Shows all response fields, only when the user account is not verified",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "info",
                            "type": "object",
                            "required": ["firstname", "surname", "email", "verificationState"],
                            "properties": {
                                "firstname": {
                                    "type": "string",
                                    "description": "First name of the account holder."
                                },
                                "surname": {
                                    "type": "string",
                                    "description": "Last name of the account holder."
                                },
                                "email": {
                                    "type": "string",
                                    "format": "email",
                                    "description": "Email address, which was used for opening up this example account."
                                },
                                "verificationState": {
                                    "type": "string",
                                    "description": "The current verification state of the user account. Determined by the state of the KYC."
                                },
                                "gender": {
                                    "type": "string",
                                    "enum": ["male", "female", null]
                                },
                                "birthday": {
                                    "type": "string",
                                    "format": "date",
                                    "description": "Birthday date of the account holder. Has to match with the KYC documents provided for verification."
                                },
                                "birthcountry": {
                                    "type": "string",
                                    "description": "The country which the account holder is born in. Shown in ISO-3 format (e.g NLD)."
                                },
                                "birthcity": {
                                    "type": "string",
                                    "description": "The city which the account holder is born in."
                                },
                                "addresscountry": {
                                    "type": "string",
                                    "description": "The country in which the account holder is currently registered as a resident. Shown in ISO-3 format (e.g NLD)."
                                },
                                "phonenumber": {
                                    "type": "string",
                                    "description": "Phone number, at which the account holder can be reached."
                                },
                                "termsAgreedVersion": {
                                    "type": "number",
                                    "format": "double",
                                    "description": "Indicator showing if the account holder has agreed with the Terms and Conditions of example."
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Account"
                ],
                "summary": "Delete the user account",
                "description": "An optional reason can be provided.",
                "parameters": [{
                    "name": "reason",
                    "in": "query",
                    "description": "Optional removal reason.",
                    "required": false,
                    "type": "string"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "status",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "description": "String indicating the result of the removal request."
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Account"
                ],
                "summary": "Create a user account with the specified user information",
                "description": "For business partners only",
                "parameters": [{
                    "name": "name",
                    "in": "formData",
                    "description": "First name of the user.",
                    "required": true,
                    "type": "string"
                }, {
                    "$ref": "#/parameters/email"
                }, {
                    "name": "apiLabel",
                    "in": "formData",
                    "description": "Label for the API Key-Secret pair, visible in account security settings.",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "activationLink",
                    "in": "formData",
                    "description": "(App)link with get variables for email and token. Protocol (like APP://) required.",
                    "required": true,
                    "type": "string",
                    "format": "url"
                }, {
                    "name": "password",
                        "in": "formData",
                        "description": "Password for the user. When left empty the account is only accesible through API.",
                        "required": false,
                        "type": "string",
                        "format": "password"
                    },{
                    "name": "activationMailTitle",
                    "in": "formData",
                    "description": "A custom title for the activation email, appears in email title and orange header.",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "activationMailMessage",
                    "in": "formData",
                    "description": "A custom message for the user in HTML, with variables %1$s for name and %2$s for email. For example:<br><br>Dear %1$s,<br><br>You have created an account at example with this<br> e-mail address (%2$s). Welcome!<br><br>Click the button below to activate your account.<br><br>We have also summarized some facts and knowledge about bitcoin in <a href=\"https://www.example.com/en/blog/everything-you-should-know-about-bitcoin\">this article</a>.Do you have any questions? Let us know. We are happy to help you!<br><br>Best regards,<br>The example team",
                    "required": false,
                    "type": "string"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "key": {
                                    "type": "string",
                                    "description": "API key, used for authorization of the account. Only works in combination with the given secret."
                                },
                                "secret": {
                                    "type": "string",
                                    "description": "API secret, used for authorization of the account. Only works in combination with the given key."
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Account"
                ],
                "summary": "Update details about the user (only possible when not verified)",
                "description": "You can check the current account information using <b>GET /account</b>.<br><br>Content-Type `multipart/form-data` not yet supported for PUT calls.",
                "parameters": [{
                    "name": "firstname",
                    "in": "formData",
                    "description": "First name of the user.",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "surname",
                    "in": "formData",
                    "description": "Surname of the user.",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "gender",
                    "in": "formData",
                    "description": "Gender (`male` or `female`)",
                    "enum": ["male", "female"],
                    "required": false,
                    "type": "string"
                }, {
                    "name": "birthday",
                    "in": "formData",
                    "description": "Date of birth (`yyyy-mm-dd`)",
                    "required": false,
                    "type": "string",
                    "format": "date"
                }, {
                    "name": "birthcountry",
                    "in": "formData",
                    "description": "Birth country in ISO 3 format eg. `NLD`",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "birthcity",
                    "in": "formData",
                    "description": "City of birth",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "addresscountry",
                    "in": "formData",
                    "description": "Residence country in ISO 3 format eg. `NLD`",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "phonenumber",
                    "in": "formData",
                    "description": "Phone number in int. standard eg. +31402359215",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "agreeOnTerms",
                    "in": "formData",
                    "description": "Phone number in int. standard eg. +31402359215",
                    "required": false,
                    "type": "boolean"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string"
                                }
                            },
                            "example": {
                                "status": "string"
                            }
                        }
                    }
                }
            }
        },
        "/account/activate": {
            "post": {
                "tags": [
                    "Account"
                ],
                "summary": "Activate an account, created through the API",
                "description": "For business partners only.",
                "parameters": [{
                    "$ref": "#/parameters/email"
                }, {
                    "$ref": "#/parameters/token"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "description": "String indicating the result of the activation request."
                                }
                            },
                            "example": {
                                "status": "string"
                            }
                        }
                    }
                }
            }
        },
        "/account/link": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "ActivateLink an existing account to a business partner app.",
                "description": "For business partners only.",
                "parameters": [{
                    "name": "email",
                    "in": "query",
                    "description": "Email of the user.",
                    "required": true,
                    "type": "string",
                    "format": "email"
                }, {
                    "name": "token",
                    "in": "query",
                    "description": "Link token of the user.",
                    "required": true,
                    "type": "string"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "description": "String indicating the result of the activation request."
                                }
                            },
                            "example": {
                                "status": "string"
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Account"
                ],
                "summary": "Request linking an account to your app by sending the user an activation email.",
                "description": "For business partners only.",
                "parameters": [{
                    "$ref": "#/parameters/email"
                }, {
                    "name": "redirect",
                    "in": "formData",
                    "description": "(App)link to redirect the user to when .",
                    "required": true,
                    "type": "string",
                    "format": "url"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "description": "String indicating the result of the activation request."
                                }
                            },
                            "example": {
                                "status": "string"
                            }
                        }
                    }
                }
            }
        },
        "/account/wallets": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Get the balance of both 'euro' and 'bitcoin' wallets",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Wallets",
                            "type": "object",
                            "properties": {
                                "Wallets": {
                                    "type": "array",
                                    "items": {
                                        "title": "Wallet",
                                        "type": "object",
                                        "properties": {
                                            "UID": {
                                                "type": "string"
                                            },
                                            "currency": {
                                                "type": "string"
                                            },
                                            "balance": {
                                                "type": "number",
                                                "format": "double"
                                            }
                                        }
                                    }
                                }
                            },
                            "example": [
                                          {
                                            "UID": "WXXXXX-XXXXX-XXXXX",
                                            "currency": "BTC",
                                            "balance": "0.00000000"
                                          },
                                          {
                                            "UID": "WXXXXX-XXXXX-XXXXX",
                                            "currency": "EUR",
                                            "balance": "0.00"
                                          }
                                        ]
                        }
                    }
                }
            }
        },
        "/account/bankAccounts": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Retrieve information about the bank accounts, currently linked to your account. Also provides information about the verification state of the bank accounts.",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Accounts",
                            "type": "object",
                            "properties": {
                                "Accounts": {
                                    "type": "array",
                                    "items": {
                                        "title": "Account",
                                        "type": "object",
                                        "properties": {
                                            "bank": {
                                                "type": "string"
                                            },
                                            "IBAN": {
                                                "type": "string"
                                            },
                                            "verified": {
                                                "type": "boolean"
                                            }
                                        }
                                    }
                                }
                            },
                            "example": [
                                          {
                                            "bank": "string",
                                            "IBAN": "string",
                                            "verified": false
                                          },
                                          {
                                            "bank": "string",
                                            "IBAN": "string",
                                            "verified": true
                                          }
                                        ]
                        }
                    }
                }
            }
        },
        "/account/transfers": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Get list of all deposits and withdrawals, done on the account. Shows both bitcoin and euro transfers.",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "DepositsWithdrawals",
                            "type": "object",
                            "properties": {
                                "DepositsWithdrawals": {
                                    "type": "array"
                                }
                            },
                            "example": [
                                            {
                                                "transferId": "string",
                                                "time": 0,
                                                "type": "string",
                                                "symbol": "string",
                                                "amount": "string",
                                                "feeSymbol": "string",
                                                "fee": "string",
                                                "description": "string",
                                                "status": "string",
                                                "contraAccount": "string"
                                            },
                                            {
                                                "transferId": "string",
                                                "time": 0,
                                                "type": "string",
                                                "symbol": "string",
                                                "amount": "string",
                                                "feeSymbol": "string",
                                                "fee": "string",
                                                "description": "string",
                                                "status": "string",
                                                "contraAccount": "string"
                                            }
                                        ]
                        }
                    }
                }
            }
        },
        "/account/transfer": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Get a specific deposit or withdrawal by transferId",
                "description": "",
                "parameters": [{
                    "name": "transferId",
                    "in": "query",
                    "description": "The ID of the transfer",
                    "required": true,
                    "type": "number"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Transfer",
                            "type": "object",
                            "properties": {
                                "DepositWithdrawal" : {
                                    "type": "object",
                                    "properties": {
                                        "transferId": {
                                            "type": "string"
                                        },
                                        "time": {
                                            "type": "number"
                                        },
                                        "type": {
                                            "type": "string"
                                        },
                                        "symbol": {
                                            "type": "string"
                                        },
                                        "amount": {
                                            "type": "string"
                                        },
                                        "feeSymbol": {
                                            "type": "string"
                                        },
                                        "fee": {
                                            "type": "string"
                                        },
                                        "description": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "contraAccount": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "example":
                                {
                                    "transferId": "string",
                                    "time": 0,
                                    "type": "string",
                                    "symbol": "string",
                                    "amount": "string",
                                    "feeSymbol": "string",
                                    "fee": "string",
                                    "description": "string",
                                    "status": "string",
                                    "contraAccount": "string"
                                }
                        }
                    }
                }
            }
        },
        "/quote/paymentmethods": {
            "get": {
                "tags": [
                    "Quoting"
                ],
                "summary": "List of all payment methods, which are available for quoting",
                "description": "<br>Payment methods have the following properties: <ul><li><b>- name</b></li><br><li><b>- lockDuration</b></li><li>The duration for which the quote price will be locked.</li><br><li><b>- type</b></li><li>The type of quote, available through this payment method. Can be 'pull' (buy) or 'push' (sell). </li></ul>",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "PaymentMethods",
                            "type": "object",
                            "properties": {
                                "PaymentMethods": {
                                    "type": "array",
                                    "items": {
                                        "title": "PaymentMethod",
                                        "type": "object",
                                        "properties": {
                                            "name": {
                                                "type": "string"
                                            },
                                            "lockDuration": {
                                                "type": "number",
                                                "description": "The duration of time, for which the price will be locked."
                                            },
                                            "type": {
                                                "type": "string",
                                                "description": "Push or pull"
                                            }
                                        }
                                    }
                                }
                            },
                            "example": [
                                        {
                                          "name": "string",
                                          "lockDuration": 0,
                                          "type": "string"
                                        },
                                        {
                                          "name": "string",
                                          "lockDuration": 0,
                                          "type": "string"
                                        }
                                    ]
                        }
                    }
                }
            }
        },
        "/quote/idealbanks": {
            "get": {
                "tags": [
                    "Quoting"
                ],
                "summary": "List of all banks supporting the iDEAL payment method",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "iDEALBanks",
                            "type": "object",
                            "properties": {
                                "iDEALBanks": {
                                    "type": "array",
                                    "items": {
                                        "title": "Bank",
                                        "type": "object",
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "Name of the bank"
                                            },
                                            "swiftBIC": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            },
                            "example": [
                                        {
                                            "name": "string",
                                            "swiftBIC": "string"
                                        },
                                        {
                                            "name": "string",
                                            "swiftBIC": "string"
                                        }
                            ]
                        }
                    }
                }
            }
        },
        "/quote/price": {
            "get": {
                "tags": [
                    "Quoting"
                ],
                "summary": "Return the current price available for quoting",
                "description": "",
                "parameters": [{
                    "name": "amount",
                    "in": "query",
                    "description": "The amount of the selected currency to price quote",
                    "required": true,
                    "type": "string"
                },
                {
                    "name": "currencyShort",
                    "in": "query",
                    "description": "The type of currency to use (BTC or EUR)",
                    "enum": ["BTC", "EUR"],
                    "required": true,
                    "type": "string"
                },
                {
                    "name": "paymentMethod",
                    "in": "query",
                    "description": "Payment method as listed in GET quote/paymentmethods",
                    "required": true,
                    "type": "string"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "priceIndication",
                            "type": "object",
                            "properties": {
                                "amount": {
                                    "type": "number",
                                    "format": "double",
                                    "description": "The amount of the selected currency for quote."
                                },
                                "toPay": {
                                    "type": "number",
                                    "format": "double",
                                    "description": "The amount to pay in EUR."
                                },
                                "btcPrice": {
                                    "type": "number",
                                    "format": "double",
                                    "description": "The bitcoin price at which you can create a quote."
                                },
                                "fee": {
                                    "type": "number",
                                    "format": "double",
                                    "description": "Fee to be taken upon paying the quote"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/quote": {
            "post": {
                "tags": [
                    "Quoting"
                ],
                "summary": "Create a new quote",
                "description": "",
                "parameters": [{
                    "$ref": "#/parameters/amount"
                }, {
                    "$ref": "#/parameters/currencyShort"
                }, {
                    "$ref": "#/parameters/paymentMethod"
                }, {
                    "$ref": "#/parameters/callBackLink"
                }, {
                    "$ref": "#/parameters/paymentParameter"
                }, {
                    "$ref": "#/parameters/directWithdrawAddress"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Result",
                            "type": "object",
                            "properties": {
                                "amount": {
                                    "type": "number",
                                    "format": "double"
                                },
                                "toPay": {
                                    "type": "number",
                                    "format": "double"
                                },
                                "btcPrice": {
                                    "type": "number",
                                    "format": "double"
                                },
                                "fee": {
                                    "type": "number",
                                    "format": "double"
                                },
                                "linkOrCode": {
                                    "type": "string"
                                },
                                "quoteId": {
                                    "type": "number"
                                },
                                "expires": {
                                    "type": "number"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Quoting"
                ],
                "parameters": [{
                    "name": "quoteId",
                    "in": "query",
                    "description": "The amount of the selected currency to price quote",
                    "required": false,
                    "type": "string"
                }],
                "summary": "List of active quotes or succesfull quotes past 24 hours. Or status of specific quote.",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Quotes",
                            "type": "array",
                            "items": {
                                "title": "Quote",
                                "type": "object",
                                "properties": {
                                    "quoteId": {
                                        "type": "string"
                                    },
                                    "created": {
                                        "type": "number",
                                        "format": "integer"
                                    },
                                    "amount": {
                                        "type": "number",
                                        "format": "double"
                                    },
                                    "toPay": {
                                        "type": "number",
                                        "format": "double"
                                    },
                                    "expires": {
                                        "type": "string"
                                    },
                                    "status": {
                                        "type": "string"
                                    },
                                    "linkOrCode": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/verification": {
            "get": {
                "tags": [
                    "Verification"
                ],
                "summary": "Get the verification status of the documents, submitted for a KYC (Know-Your-Customer)",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Verification",
                            "type": "object",
                            "properties": {
                                "identity": {
                                    "type": "object",
                                    "description": "Verification status of the identity document (passport, ID card, driving license)."
                                },
                                "address": {
                                    "type": "object",
                                    "description": "Verification status of the address proof document."
                                }
                            },
                            "example": {
                                      "identity": {
                                        "passport": {
                                          "progressState": "string"
                                        }
                                      },
                                      "address": {
                                        "proof": {
                                          "progressState": "string"
                                        }
                                      }
                                    }
                        }
                    }
                }
            }
        },
        "/verification/identity": {
            "post": {
                "tags": [
                    "Verification"
                ],
                "summary": "Upload an identity document, which will be used for the KYC verification",
                "description": "Identity documents should be: valid (expiry date clearly visible), not rotated, maximum 4 MB per file. Masking person identification number is not allowed. Watermarking/timestamping the file is allowed.<br><br><p><b>For accounts created through the API</b>, the KYC procedure will start only when: <ul><li>- All the required documents are supplied (identity and proof of residence).</li><li>- The account information is entered (PUT /account).</li><li>- The account holder has agreed on the Terms and Conditions.</li></ul></p>",
                "consumes": [
                    "multipart/form-data"
                ],
                "parameters": [{
                    "name": "type",
                    "in": "formData",
                    "description": "Either `passport` or `identityCard`.",
                    "enum": ["passport", "identityCard"],
                    "required": true,
                    "type": "string"
                }, {
                    "name": "nationality",
                    "in": "formData",
                    "description": "Country of nationality in ISO 3 format eg. `NLD`.",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "ipaddress",
                    "in": "formData",
                    "description": "Client IP address while submitting files.",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "useragent",
                    "in": "formData",
                    "description": "Client user agent while submitting files.",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "primaryFile",
                    "in": "formData",
                    "description": "Passport or identityCard front (pdf, jpg, png or tiff).",
                    "required": true,
                    "type": "file"
                }, {
                    "name": "secondaryFile",
                    "in": "formData",
                    "description": "identityCard back (pdf, jpg, png or tiff).",
                    "required": false,
                    "type": "file"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string"
                                }
                            },
                            "example": {
                                "status": "string"
                            }
                        }
                    }
                }
            }
        },
        "/verification/address": {
            "post": {
                "tags": [
                    "Verification"
                ],
                "summary": "Upload a proof of residence document, which will be used for the KYC verification",
                "description": "<p>The proof of residence must be:<ul><li>- maximum 3 months old.</li><li>- containing name and address.</li></ul><br><br><b>Allowed documents are:</b><ul><li>- bills for gas, water or electricity.</li><li>- tax bills, internet or landline phone bills.</li><li>- government / municipality extract with address</li><li>- an extract from the population</li></ul><br><b>Important:</b><ul><li>Mobile phone bills are <b>NOT allowed</b>.</li><li>Selfie letter service is currently unavailable, please contact us, if you need to use it.</li></ul> <br><br><b>For accounts created through the API</b>, the KYC procedure will start only when:<ul><li>- All the required documents are supplied (identity and proof of residence).</li><li>- The account information is entered (PUT /account).</li><li>- The account holder has agreed on the Terms and Conditions.</li></ul></p>",
                "consumes": [
                    "multipart/form-data"
                ],
                "parameters": [{
                    "name": "type",
                    "in": "formData",
                    "description": "The type of address verification. Either 'proofofresidence' or 'selfieletter'.",
                    "enum": ["proofofresidence", "selfieletter"],
                    "required": true,
                    "type": "string"
                }, {
                    "name": "address",
                    "in": "formData",
                    "description": "Street name + house number",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "zipcode",
                    "in": "formData",
                    "description": "Postal (Zip) code",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "city",
                    "in": "formData",
                    "description": "City of residence",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "country",
                    "in": "formData",
                    "description": "Country of residence in ISO 3 format eg. `NLD`",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "proofFile",
                    "in": "formData",
                    "description": "Proof of residence (PDF, JPG, PNG or TIFF) if type is `proofofresidence`.",
                    "required": false,
                    "type": "file"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string"
                                }
                            },
                            "example": {
                                "status": "string"
                            }
                        }
                    }
                }
            }
        },
        "/verification/bank": {
            "get": {
                "tags": [
                    "Verification"
                ],
                "parameters": [{
                    "name": "BIC",
                    "in": "query",
                    "description": "The BIC of the bank",
                    "required": false,
                    "type": "number"
                }],
                "summary": "Check if the BIC (SWIFT) of the bank is known in example system. If so bankname, country & address are not necessary when verifying a new bank account.",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "BIC",
                            "type": "object",
                            "properties": {
                                "known": {
                                    "type": "boolean",
                                    "description": "True if the bank is known in the example system."
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Verification"
                ],
                "summary": "Add a new bank account",
                "description": "Upload a bank statement with a clearly visible IBAN and account holder name (not rotated, maximum 4 MB per file).<br>You can mask the balance and transaction details and putting a watermark or timestamp on the file is allowed.<br><br><b>Note:</b> Bankname, country & address are only necessary for banks, unknown to the example system. Use 'GET /verification/bank' to check.",
                "consumes": [
                    "multipart/form-data"
                ],
                "parameters": [ {
                    "name": "accountholder",
                    "in": "formData",
                    "description": "Country of nationality in ISO-3 format eg. `NLD`",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "IBAN",
                    "in": "formData",
                    "description": "IBAN of the bank account",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "BIC",
                    "in": "formData",
                    "description": "BIC (SWIFT) of the bank",
                    "required": true,
                    "type": "string"
                }, {
                    "name": "bankStatement",
                    "in": "formData",
                    "description": "Bank statement (PDF, JPG, PNG or TIFF)",
                    "required": true,
                    "type": "file"
                }, {
                    "name": "bankname",
                    "in": "formData",
                    "description": "Client IP address while submitting files",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "country",
                    "in": "formData",
                    "description": "Country of the bank in ISO-3 format",
                    "required": false,
                    "type": "string"
                }, {
                    "name": "address",
                    "in": "formData",
                    "description": "Address of the head office of the bank",
                    "required": false,
                    "type": "string"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string"
                                }
                            },
                            "example": {
                                "status": "string"
                            }
                        }
                    }
                }
            }
        },
        "/verification/business": {
            "post": {
                "tags": [
                    "Verification"
                ],
                "summary": "Upload business specific document(s)",
                "description": "Business documents should be:<ul><li>- valid (expiry date clearly visible).</li><li>- not rotated.</li><li>- maximum 4 MB per file.</li></ul><br>Watermarking/timestamping the file is allowed.",
                "consumes": [
                    "multipart/form-data"
                ],
                "parameters": [{
                    "name": "type",
                    "in": "formData",
                    "description": "Options are: `ChamberOfCommerce`, `Incorporation`, `Other1`, `Other2`, `Other3`, `Other4` and `Other5`.",
                    "enum": ["ChamberOfCommerce", "Incorporation", "Other1", "Other2", "Other3", "Other4", "Other5"],
                    "required": true,
                    "type": "string"
                }, {
                    "name": "primaryFile",
                    "in": "formData",
                    "description": "Image (pdf, jpg, png or tiff)",
                    "required": true,
                    "type": "file"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Account API information",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string"
                                }
                            },
                            "example": {
                                "status": "string"
                            }
                        }
                    }
                }
            }
        },
        "/verification/token": {
            "get": {
                "tags": [
                    "Verification"
                ],
                "summary": "Get authorization token for user. With this token you can start a session with limited interface to complete verification",
                "description": "",
                "parameters": [{
                    "name": "redirect",
                    "in": "query",
                    "description": "URL to redirect to after authenticated session ends (typically when a user finished verifying).",
                    "required": true,
                    "type": "string",
                    "format": "url"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "info",
                            "type": "object",
                            "properties": {
                                "token": {
                                    "type": "string"
                                },
                                "expires": {
                                    "type": "number",
                                    "description": "Expiration timestamp of the token"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/verification/creditcard": {
            "post": {
                "tags": [
                    "Verification"
                ],
                "parameters": [
                    {
                        "name": "walletUID",
                        "in": "formData",
                        "description": "UID of an EURO wallet",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "creditcardNumber",
                        "in": "formData",
                        "description": "Credit card number",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "creditcardExpiry",
                        "in": "formData",
                        "description": "Expiry date, Format: month/year, 11/2021",
                        "required": true,
                        "type": "string",
                        "format": "date"
                    },
                    {
                        "name": "creditcardCCV",
                        "in": "formData",
                        "description": "Creditcard security code",
                        "required": true,
                        "type": "number"
                    }
                ],
                "summary": "Start creditcard verification",
                "description": "An verification amount will be charged of your creditcard. ou must confirm the exact amount to be able to use this credit card.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Verification started",
                            "type": "object",
                            "properties": {
                                "result" : {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/verification/creditcard/confirm": {
            "post": {
                "tags": [
                    "Verification"
                ],
                "parameters": [
                    {
                        "name": "walletUID",
                        "in": "formData",
                        "description": "UID of an EURO wallet",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "creditcardNumber",
                        "in": "formData",
                        "description": "Creditcard number",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "amount",
                        "in": "formData",
                        "description": "Verification amount",
                        "required": true,
                        "type": "number",
                        "format": "double"
                    }
                ],
                "summary": "Confirm creditcard verification",
                "description": "Confirm creditcard",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Verification result",
                            "type": "object",
                            "properties": {
                                "result" : {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/bitcoin/depositAddress": {
            "get": {
                "tags": [
                    "Funds"
                ],
                "summary": "Obtain Bitcoin address to deposit",
                "parameters": [{
                    "name": "new",
                    "in": "query",
                    "description": "Create a new address in stead of using an existing",
                    "required": false,
                    "type": "boolean"
                }],
                "description": "Retrieve a single Bitcoin address which can be used to deposit money to your example Bitcoin wallet. If no previous Bitcoin address is available, a new one will be generated.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Bitcoin address",
                            "type": "object",
                            "properties": {
                                "address" : {
                                    "type": "string"
                                }
                            },
                            "example": {
                                "address" : "string"
                            }
                        }
                    }
                }
            }
        },
        "/bitcoin/withdrawal": {
            "post": {
                "tags": [
                    "Funds"
                ],
                "parameters": [{
                    "name": "amount",
                    "in": "formData",
                    "description": "The amount of bitcoins to withdraw to the specified address",
                    "required": true,
                    "type": "number",
                    "format": "double"
                }, {
                    "$ref": "#/parameters/toAddress"
                }],
                "summary": "Withdraw bitcoins",
                "description": "Execute a Bitcoin transaction by withdrawing money from your example Bitcoin wallet to another Bitcoin wallet. The current transaction fee as determined by the network will be applied to the amount you specify.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Withdrawal ID",
                            "type": "object",
                            "properties": {
                                "withdrawalID" : {
                                    "type": "number"
                                }
                            },
                            "example": {
                                "withdrawalID": "00000000"
                            }
                        }
                    }
                }
            }
        },
        "/bitcoin/internalTransfer": {
            "post": {
                "tags": [
                    "Funds"
                ],
                "parameters": [{
                    "name": "amount",
                    "in": "formData",
                    "description": "The amount of bitcoins to send to the specified user account",
                    "required": true,
                    "type": "number",
                    "format": "double"
                }, {
                    "name": "email",
                    "in": "formData",
                    "required": true,
                    "type": "string",
                    "format": "email",
                    "description": "Email of the user on example to transfer the bitcoins to"
                }],
                "summary": "Transfer bitcoins to example user",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "status",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/euro/deposit/sepa": {
            "get": {
                "tags": [
                    "Funds"
                ],
                "summary": "Obtain SEPA deposit instructions",
                "description": "Retrieve all the details a user have to fill in the SEPA transfer on his bank website",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "SEPA instructions",
                            "type": "object",
                            "properties": {
                                "IBAN" : {
                                    "type": "string"
                                },
                                "BIC" : {
                                    "type": "string"
                                },
                                "description" : {
                                    "type": "string"
                                },
                                "recipientName" : {
                                    "type": "string"
                                },
                                "recipientAddress" : {
                                    "type": "string"
                                },
                               "recipientZipcode" : {
                                    "type": "string"
                                },
                               "recipientCity" : {
                                    "type": "string"
                                },
                               "recipientCountry" : {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/euro/deposit/creditcard": {
            "post": {
                "tags": [
                    "Funds"
                ],
                "parameters": [
                    {
                        "name": "walletUID",
                        "in": "formData",
                        "description": "UID of an EURO wallet",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "creditcardNumber",
                        "in": "formData",
                        "description": "Creditcard number",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "creditcardExpiry",
                        "in": "formData",
                        "description": "Expiry date, Format: month/year, 11/2021",
                        "required": true,
                        "type": "string",
                        "format": "date"
                    },
                    {
                        "name": "creditcardCCV",
                        "in": "formData",
                        "description": "Creditcard security code",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "amount",
                        "in": "formData",
                        "description": "The amount of euros to deposit",
                        "required": true,
                        "type": "number",
                        "format": "double"
                    },
                    {
                        "name": "redirectUrl",
                        "in": "formData",
                        "description": "URL used for redirection",
                        "required": true,
                        "type": "string"
                    }
                ],
                "summary": "Start Creditcardtransaction",
                "description": "Start creditcard transaction",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Creditcard transaction infromation",
                            "type": "object",
                            "properties": {
                                "paymentURI" : {
                                    "type": "string"
                                },
                                "creditcardUUID" : {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Funds"
                ],
                "parameters": [
                    {
                        "name": "creditcardUUID",
                        "in": "query",
                        "description": "creditcardUUID",
                        "required": true,
                        "type": "string"
                    }
                ],
                "summary": "Get status creditcardtransaction",
                "description": "Get status creditcardtransaction",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Creditcard transaction result",
                            "type": "object",
                            "properties": {
                               "status": {
                                    "type": "string"
                               }
                            }
                        }
                    }
                }
            }
        },
         "/euro/deposit/ideal": {
            "post": {
                "tags": [
                    "Funds"
                ],
                "parameters": [
                    {
                        "name": "walletUID",
                        "in": "formData",
                        "description": "UID of an EURO wallet",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "bankSwiftBIC",
                        "in": "formData",
                        "description": "Ideal allowed bank SwiftBIC",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "amount",
                        "in": "formData",
                        "description": "The amount of euros to deposit",
                        "required": true,
                        "type": "number",
                        "format": "double"
                    },
                    {
                        "name": "redirectUrl",
                        "in": "formData",
                        "description": "URL used for redirection",
                        "required": true,
                        "type": "string"
                    }
                ],
                "summary": "Start idealtransaction",
                "description": "Start ideal transaction",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Ideal transaction url and id",
                            "type": "object",
                            "properties": {
                                "paymentURI" : {
                                    "type": "string"
                                },
                                "iDealId" : {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Funds"
                ],
                "parameters": [
                    {
                        "name": "iDealUUID",
                        "in": "query",
                        "description": "iDealUUID",
                        "required": true,
                        "type": "string"
                    }
                ],
                "summary": "Get status idealtransaction",
                "description": "Get status idealtransaction",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "IdealTransaction result",
                            "type": "object",
                            "properties": {
                               "status": {
                                    "type": "string"
                               }
                            }
                        }
                    }
                }
            }
        },
        "/euro/deposit/ideal/banks": {
            "get": {
                "tags": [
                    "Funds"
                ],
                "summary": "List of all banks supporting the iDEAL payment method",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "iDEALBanks",
                            "type": "object",
                            "properties": {
                                "iDEALBanks": {
                                    "type": "array",
                                    "items": {
                                        "title": "Bank",
                                        "type": "object",
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "Name of the bank"
                                            },
                                            "swiftBIC": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            },
                            "example": [
                                        {
                                            "name": "string",
                                            "swiftBIC": "string"
                                        },
                                        {
                                            "name": "string",
                                            "swiftBIC": "string"
                                        }
                            ]
                        }
                    }
                }
            }
        },
        "/euro/withdrawal": {
            "post": {
                "tags": [
                    "Funds"
                ],
                "parameters": [{
                    "name": "amount",
                    "in": "formData",
                    "description": "The amount of euros to withdraw to the specified IBAN",
                    "required": true,
                    "type": "number",
                    "format": "double"
                }, {
                    "$ref": "#/parameters/IBAN"
                }, {
                    "$ref": "#/parameters/sepadescription"
                }],
                "summary": "Withdraw euros",
                "description": "Execute a euro transaction to a specified IBAN. The IBAN must be linked to your example account in order for the transaction to be done.",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Withdrawal ID",
                            "type": "object",
                            "properties": {
                                "withdrawalID": {
                                    "type": "number"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/euro/internalTransfer": {
            "post": {
                "tags": [
                    "Funds"
                ],
                "parameters": [{
                    "name": "amount",
                    "in": "formData",
                    "description": "The amount of euros to send to the specified user account",
                    "required": true,
                    "type": "number",
                    "format": "double"
                }, {
                    "name": "email",
                    "in": "formData",
                    "required": true,
                    "type": "string",
                    "format": "email",
                    "description": "Email of the user on example to transfer the euros to"
                }],
                "summary": "Transfer euros to example user",
                "description": "",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "status",
                            "type": "object",
                            "properties": {
                                "status": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/funds/ledger": {
            "get": {
                "tags": [
                    "Funds"
                ],
                "summary": "Get legder entries of your mutations",
                "description": "Retrieve up to 50 ledger entries, use pagination (ofset) to retrieve every mutation.",
                "parameters": [{
                    "name": "currency",
                    "in": "query",
                    "description": "Only view ledger entries of specific currency",
                    "enum": ["all","BTC", "EUR"],
                    "required": false,
                    "type": "string"
                },
                {
                    "name": "type",
                    "in": "query",
                    "description": "The type of ledger entries to require",
                    "enum": ["all", "deposit", "withdrawal", "trade"],
                    "required": false,
                    "type": "string"
                },
                {
                    "name": "start",
                    "in": "query",
                    "description":"Starting unix timestamp or ledger id of results (exclusive)",
                    "required": false,
                    "type": "string"
                },
                {
                    "name": "end",
                    "in": "query",
                    "description": "Ending unix timestamp or ledger id of results (inclusive)",
                    "required": false,
                    "type": "string"
                },
                {
                    "name": "offset",
                    "in": "query",
                    "description": "Result offset",
                    "required": false,
                    "type": "string"
                }],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "Ledger",
                            "type": "object",
                            "properties": {
                                "ledger": {
                                    "type": "array",
                                    "items": {
                                        "title": "record",
                                        "type": "object",
                                        "properties": {
                                            "refid": {
                                                "type": "string"
                                            },
                                            "time": {
                                                "type": "number"
                                            },
                                            "type": {
                                                "type": "string"
                                            },
                                            "currency": {
                                                "type": "string"
                                            },
                                            "amount": {
                                                "type": "number",
                                                "format": "double"
                                            },
                                            "fee": {
                                                "type": "number",
                                                "format": "double"
                                            }
                                        }
                                    }
                                },
                                "count": {
                                    "type": "number"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/utility/countries": {
            "get": {
                "tags": [
                    "Utility"
                ],
                "summary": "Get countries",
                "description": "Get countries",
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "App",
                            "type": "object",
                            "properties": {

                            }
                        }
                    }
                }
            }
        }
    },
    "parameters": {
        "email": {
            "name": "email",
            "in": "formData",
            "description": "Email of the user.",
            "required": true,
            "type": "string",
            "format": "email"
        },
        "toAddress": {
            "name": "toAddress",
            "in": "formData",
            "description": "Bitcoin address to which the bitcoins will be sent.",
            "required": true,
            "type": "string"
        },
        "kycdoc": {
            "name": "kycdoc",
            "in": "formData",
            "description": "KYC document ()",
            "required": true,
            "type": "file"
        },
        "token": {
            "name": "token",
            "in": "formData",
            "description": "Authentication token for the user.",
            "required": true,
            "type": "string"
        },
        "type": {
            "name": "type",
            "in": "formData",
            "description": "The type of order - 'bid' or 'ask'.",
            "enum": ["bid", "ask"],
            "required": true,
            "type": "string"
        },
        "amount": {
            "name": "amount",
            "in": "formData",
            "description": "The amount of the chosen currency to be bought or sold.",
            "required": true,
            "type": "string"
        },
        "timelimit": {
            "name": "timelimit",
            "in": "formData",
            "description": "Timelimit in seconds. Min 10 seconds",
            "required": false,
            "type": "number"
        },
        "currencyShort": {
            "name": "currencyShort",
            "in": "formData",
            "description": "The type of currency to use (BTC or EUR).",
            "enum": ["BTC", "EUR"],
            "required": true,
            "type": "string"
        },
        "paymentMethod": {
            "name": "paymentMethod",
            "in": "formData",
            "description": "Payment method as listed in quote/paymentmethods.",
            "required": true,
            "type": "string"
        },
        "paymentParameter": {
            "name": "paymentParameter",
            "in": "formData",
            "description": "Specific parameter for payment methods (bank BIC for iDEAL).",
            "required": false,
            "type": "string"
        },
        "callBackLink": {
            "name": "callBackLink",
            "in": "formData",
            "description": "Link for redirecting back.",
            "required": true,
            "type": "string"
        },
        "directWithdrawAddress": {
            "name": "directWithdrawAddress",
            "in": "formData",
            "description": "Valid bitcoin address for direct withdraw of funds after buy.",
            "required": false,
            "type": "string"
        },
        "price": {
            "name": "price",
            "in": "formData",
            "description": "The price at which the trade will be done.",
            "required": true,
            "type": "number",
            "format": "double"
        },
        "euroAmount": {
            "name": "euroAmount",
            "in": "formData",
            "description": "Amount of euros.",
            "required": true,
            "type": "number",
            "format": "double"
        },
        "btcAmount": {
            "name": "btcAmount",
            "in": "formData",
            "description": "Amount of bitcoins.",
            "required": true,
            "type": "number",
            "format": "double"
        },
        "IBAN": {
            "name": "toIBAN",
            "in": "formData",
            "description": "IBAN of the account, which will receive the euro funds.",
            "required": true,
            "type": "number"
        },
        "sepadescription": {
            "name": "sepadescription",
            "in": "formData",
            "description": "Description to put in the Euro transaction. The length must be shorter than 23 characters.",
            "required": false,
            "type": "string"
        }
    }
}
wing328 commented 8 years ago

One of the responses is defined as follows:

                    "200": {
                        "description": "Successful response",
                        "schema": {
                            "title": "DepositsWithdrawals",
                            "type": "object",
                            "properties": {
                                "DepositsWithdrawals": {
                                    "type": "array"
                                }
                            },
                            "example": [
                                            {
                                                "transferId": "string",

As you can see, the property DepositsWithdrawals is an array but without any proper items defined. Please fix that and review other inline model definitions.

I tried to generate PHP client but only got warnings.

Which codegen version did you use? Please try the latest master.

Stormyy commented 8 years ago

Im now using a fresh clone from master (swagger-generator does fail on building though (Some tests failed). Don't know if this is a problem?) and updated DepositsWithdrawals array.I can generate most languages except for PHP strange enough. It somehow can't create files for PHP. I tried using cygwin and windows terminal.

Exception in thread "main" java.lang.RuntimeException: Could not generate model 'inline_response_200_11'
        at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:215)
        at io.swagger.codegen.cmd.Generate.run(Generate.java:188)
        at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: java.lang.IllegalArgumentException: character to be escaped is missing
        at java.util.regex.Matcher.appendReplacement(Unknown Source)
        at java.util.regex.Matcher.replaceAll(Unknown Source)
        at java.lang.String.replaceAll(Unknown Source)
        at io.swagger.codegen.languages.PhpClientCodegen.toPackagePath(PhpClientCodegen.java:132)
        at io.swagger.codegen.languages.PhpClientCodegen.modelFileFolder(PhpClientCodegen.java:224)
        at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:196)
        ... 2 more
Stormyy commented 8 years ago

The problem isnt my spec just tested http://petstore.swagger.io/v2/swagger.json and it also fails :disappointed:

wing328 commented 8 years ago

OK. We'll look into that.

For the build error on Windows, we've another PR (#1633) for that.

wing328 commented 8 years ago

As a workaround, please use the online code generator: https://github.com/swagger-api/swagger-codegen#online-generators

danil-mk commented 8 years ago

I had the same problem. It occurred only on Windows. I suppose it is a problem with "replaceAll" method and "File.separator" in the replacement in Class "io.swagger.codegen.languages.PhpClientCodegen" in line 125:

packageName.replaceAll("[\.\\/]", File.separator)

This problem could be solved by changing this line (as described here) to:

packageName.replaceAll("[\.\\/]", Matcher.quoteReplacement(File.separator))

wing328 commented 8 years ago

@danil-mk thanks for suggesting a fix. Do you have cycle to test the fix and submit a PR? or you would like me to submit a PR based on your suggestion?

Ref: Guidelines for Contribution

danil-mk commented 8 years ago

@wing328 sorry but i have currently no time to fix this (and test it properly ;)) so feel free to fix it!

wing328 commented 8 years ago

@danil-mk @Stormyy I've filed a PR with the suggested fix but didn't have time to perform any test in windows. Do you mind performing some tests on Windows? Here are the steps:

git clone https://github.com/wing328/swagger-codegen.git
cd swagger-codegen
git checkout issue1623
mvn clean install

and then use it to generate PHP API client.

wing328 commented 8 years ago

The fix has been tested on Windows and merged into master. Please reopen this issue if you still encounter the error.

twopelu commented 6 years ago

Hi all! I've just cloned the swagger-codegen repo and I'm having the same problem...

I have tested first with the online Swagger Editor and it works well, but when I try from the command line I get this error:

D:\DANI\vscode\plant-keep-server>java -jar D:\DANI\software\swagger-codegen-master\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i swagger.yaml -l nodejs-server -o plant-keep-server
[main] INFO io.swagger.parser.Swagger20Parser - reading from swagger.yaml
[main] INFO io.swagger.codegen.DefaultCodegen - Skipped overwriting index.js as the file already exists in D:\DANI\vscode\plant-keep-server\plant-keep-server\\index.js
[main] INFO io.swagger.codegen.DefaultCodegen - Skipped overwriting package.json as the file already exists in D:\DANI\vscode\plant-keep-server\plant-keep-server\\package.json
[main] INFO io.swagger.codegen.DefaultCodegen - Skipped overwriting README.md as the file already exists in D:\DANI\vscode\plant-keep-server\plant-keep-server\\README.md
Exception in thread "main" java.lang.RuntimeException: Could not generate api file for 'Plants'
        at io.swagger.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:543)
        at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:750)
        at io.swagger.codegen.cmd.Generate.run(Generate.java:285)
        at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: java.lang.IllegalArgumentException: character to be escaped is missing
        at java.util.regex.Matcher.appendReplacement(Unknown Source)
        at java.util.regex.Matcher.replaceAll(Unknown Source)
        at java.lang.String.replaceAll(Unknown Source)
        at io.swagger.codegen.languages.NodeJSServerCodegen.apiFilename(NodeJSServerCodegen.java:163)
        at io.swagger.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:496)
        ... 3 more

The Yaml and Json files (I tested both with same error): swagger.zip

I really appreciate any help, I'm new to this! hehe :-)