swagger source below. when run swagger-tools validator, receive no errors. when load in editor, see output incorrect - shows wrong types, , incomplete member object. when try use code generator cli java tool, following errors:
711 [main] error io.swagger.models.properties.propertybuilder - no property null, null 712 [main] warn io.swagger.util.propertydeserializer - no property null, null, {enum=null, title=null, description=null, default=null, pattern=null, descriminator=null, min_items=null, max_items=null, min_properties=null, max_properties=null, min_length=null, max_length=null, minimum=null, maximum=null, exclusive_minimum=null, exclusive_maximum=null, unique_items=null, example=null, type=null, format=null} 822 [main] error io.swagger.codegen.defaultcodegen - unexpected missing property name null 822 [main] warn io.swagger.codegen.defaultcodegen - skipping invalid property { "type" : "array" }
{ "swagger": "2.0", "info": { "title": "v1 inmar crm api", "description": "crm api", "version": "1.0.0" }, "produces": ["application/json"], "basepath": "/v1", "paths": { "/member": { "get": { "x-swagger-router-controller": "member", "tags": ["member"], "operationid": "getmember", "parameters": [ { "$ref": "#/parameters/x-inmar-rest-api-key" }, { "$ref": "#/parameters/x-inmar-memberid" } ], "responses": { "200": { "description": "success", "schema": { "$ref": "#/definitions/member" } } } }, "post": { "x-swagger-route-controller": "member", "tags": ["member"], "operationid": "postmember", "parameters": [ { "$ref": "#/parameters/x-inmar-rest-api-key" }, { "$ref": "#/parameters/x-inmar-memberid" }, { "$ref": "#/parameters/member" } ], "responses": { "200": { "$ref": "#/responses/generic-200" } } } } }, "parameters": { "x-inmar-rest-api-key": { "name": "x-inmar-rest-api-key", "description": "api access key.", "in": "header", "required": true, "type": "string" }, "x-inmar-memberid": { "name": "x-inmar-memberid", "description": "unique id member.", "in": "header", "required": true, "type": "string" }, "member": { "description": "member object", "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/member" } } }, "responses": { "generic-200": { "description": "success" } }, "definitions": { "member": { "description": "member", "type": "object", "properties": { "active": { "type": "boolean", "default": true }, "identity": { "type": "object", "required": [ "user_id" ], "properties": { "user_id": { "type": "string", "maxlength": 50, "format": "email" }, "password": { "type": "string", "minlength": 8, "maxlength": 20 }, "proxy_id": { "type": "integer" } } }, "pii": { "type": "object", "description": "personally_identifiable_information.", "properties": { "alt_email": { "type": "string", "description": "secondary email addresses may or may not match id.", "format": "email" }, "first_name": { "type": "string", "minlength": 1, "maxlength": 25 }, "last_name": { "type": "string", "minlength": 1, "maxlength": 25 }, "primary_address_one": { "type": "string", "minlength": 1, "maxlength": 47 }, "primary_address_two": { "type": "string", "minlength": 1, "maxlength": 47 }, "primary_address_city": { "type": "string", "minlength": 1, "maxlength": 47 }, "primary_address_state": { "type": "string", "minlength": 2, "maxlength": 2, "description": "us states , territories , canadian provinces.", "enum": [ "aa", "ab", "ae", "ak", "al", "ap", "ar", "as", "az", "bc", "ca", "co", "ct", "dc", "de", "fl", "fm", "ga", "gu", "hi", "ia", "id", "il", "in", "ks", "ky", "la", "ma", "mb", "md", "me", "mh", "mi", "mn", "mo", "mp", "ms", "mt", "nb", "nc", "nd", "ne", "nh", "nj", "nl", "nm", "ns", "nt", "nu", "nv", "ny", "oh", "ok", "on", "or", "pa", "pe", "pr", "pw", "qc", "ri", "sc", "sd", "sk", "tn", "tx", "uk", "ut", "va", "vi", "vt", "wa", "wi", "wv", "wy", "yt" ] }, "primary_address_postal_code": { "type": "string", "minlength": 5, "maxlength": 10 }, "primary_address_country": { "type": "string", "enum": [ "us", "ca" ] }, "birthdate": { "type": "string" }, "language_preference": { "type": "string" }, "gender": { "type": "string", "enum": [ "male", "female" ] } } }, "profiles": { "type": "array", "items": { "properties": { "site_id": { "type": "integer" }, "survey_data": { "type": "object", "required": [ "survey_id", "survey_responses" ], "properties": { "survey_id": { "type": "integer", "description": "unique identifier of profile survey." }, "survey_responses": { "type": "array", "items": { "required": [ "question_id", "response_id", "free_form_value" ], "properties": { "question_id": { "type": "integer", "description": "unique identifier of profile survey question." }, "response_id": { "type": "integer", "description": "unique identifier of profile question response.", "default": 0 }, "free_form_value": { "type": "string", "description": "consumer free form response", "default": "" } } } } } } } } }, "optins": { "type": "array", "items": { "$ref": "#/definitions/optin" } } } }, "optin": { "description": "survey response", "type": "object", "properties":{ "optin_id": { "type": "integer", "description": "unique identifier of opt in question/choice. e.g. newsletter" }, "optin_value": { "type": "integer", "enum": [ 0, 1 ], "description": "optin response of 0=optout , 1=optin" } }, "required": [ "optin_id", "optin_value" ] } } }
Comments
Post a Comment