Hello,
 we are trying to use a swager
https://developers.cloudtalk.io/swagger.json

after trying exporting it to csharp via swagger hub, it can't be assembled.

The model is generated incorectly see below the exceprt from one of the 
classes



*namespace IO.Swagger.Model*
*{*
*    /// <summary>*
*    /// Body1*
*    /// </summary>*
*    [DataContract]*
*    public partial class Body1 :  IEquatable<Body1>, IValidatableObject*
*    {*
*  .......*
*.........*

*        /// <summary>*
*        /// Gets or Sets Firstname*
*        /// </summary>*
*        [DataMember(Name="firstname", EmitDefaultValue=false)]*
*        public Agentpropertiesfirstname Firstname { get; set; }*

*        /// <summary>*
*        /// Gets or Sets Lastname*
*        /// </summary>*
*        [DataMember(Name="lastname", EmitDefaultValue=false)]*
*        public Agentpropertieslastname Lastname { get; set; }*

*        /// <summary>*
*        /// Gets or Sets Email*
*        /// </summary>*
*        [DataMember(Name="email", EmitDefaultValue=false)]*
*        public Agentpropertiesemail Email { get; set; }*

.....

Obviously this generates errors like

*Error CS0246 The type or namespace name 'Agentpropertiesemail' could not 
be found (are you missing a using directive or an assembly reference?) 
phoonio C:\!metaapp\swagtest\phoonio\phoonio\Model\Body.cs 34 Active*



The part of the swagger looks like this 

*   "/agents/add.json": {*
*            "put": {*
*                "tags": [*
*                    "agents"*
*                ],*
*                "summary": "Add an agent",*
*                "consumes": [*
*                    "application/json"*
*                ],*
*                "produces": [*
*                    "application/json"*
*                ],*
*                "parameters": [*
*                    {*
*                        "name": "body",*
*                        "in": "body",*
*                        "required": true,*
*                        "schema": {*
*                            "required": [*
*                                "firstname",*
*                                "lastname",*
*                                "email"*
*                            ],*
*                            "properties": {*
*                                "firstname": {*
*                                    "$ref": 
"#/definitions/Agent/properties/firstname"*
*                                },*
*                                "lastname": {*
*                                    "$ref": 
"#/definitions/Agent/properties/lastname"*
*                                },*
*                                "email": {*
*                                    "$ref": 
"#/definitions/Agent/properties/email"*
*                                },*
*                                "status_outbound": {*
*                                    "$ref": 
"#/definitions/Agent/properties/status_outbound"*
*                                },*
*                                "daily_price_limit": {*
*                                    "$ref": 
"#/definitions/Agent/properties/daily_price_limit"*
*                                }*
*                            },*
*                            "type": "object"*
*                        }*
*                    }*
*                ],*



---------------------
when I tried my modification bellow, it worked fine, and the c# code was 
compilable
---------------------

*  /agents/add.json:*
*    put:*
*      tags:*
*        - agents*
*      summary: Add an agent*
*      consumes:*
*        - application/json*
*      produces:*
*        - application/json*
*      parameters:*
*        - name: body*
*          in: body*
*          required: true*
*          schema:*
*              $ref: '#/definitions/Agent'*



*definitions:*
*  Agent:*
*    description: Agent data*
*    properties:*
*      id:*
*        description: Agent ID*
*        type: integer*
*      name:*
*        description: Agent\'s Voice ID*
*        type: string*
*      firstname:*
*        description: First name*
*        type: string*
*      lastname:*
*        description: Last name*
*        type: string*
*      email:*
*        description: Email*
*        type: string*
*        format: email*
*      daily_price_limit:*
*        description: >-*
*          Daily price limit for all calls in EUR. Usually allowed values 
are*
*          from 1 to 200 EUR. Leave empty for using default value.*
*        type: integer*
*        default: 20*
*        maximum: 200*
*        minimum: 1*
*      is_daily_limit_ok:*
*        description: 'Is daily price limit OK? If not, agent cannot make 
new calls'*
*        type: boolean*
*      status_outbound:*
*        description: Does agent have outbound calls allowed?*
*        type: boolean*
*      availability_status:*
*        description: Current availability status of the agent*
*        type: string*
*        enum:*
*          - online*
*          - offline*
*          - paused*
*          - calling*
*      extension:*
*        description: Extension of agent*
*        type: integer*
*    type: object*



Is cloud talk swagger format wrong, or what do you suggest?



-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to