Skip to content

code gen (javascript) fails if schema uses items with array value #858

New issue

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

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

Already on GitHub? Sign in to your account

Closed
Shulamite opened this issue Dec 16, 2016 · 1 comment
Closed

Comments

@Shulamite
Copy link

java script generation fails with a swagger that uses items with array value:

swagger: '2.0'
info:
title: metadata for order
version: 11.1.13
description: metadata for order
paths:
'/api/version/orders/{id}':
parameters:
- name: id
in: path
description: order id
type: integer
required: true
get:
produces:
- application/vnd.oracle.resource+json;type=singular
consumes:
- application/x-www-form-urlencoded
summary: Retrieve an order instance
description: Retrieve an order instance
operationId: getOrder
responses:
default:
schema:
$ref: '#/definitions/order'
description: return order successfully
patch:
produces:
- application/vnd.oracle.resource+json;type=singular
consumes:
- application/vnd.oracle.resource+json;type=singular
summary: Update an order instance
description: Update an order instance
operationId: updateOrder
responses:
default:
schema:
$ref: '#/definitions/order'
description: order updated successfully
parameters:
- name: request
description: >-
The following table describes the body parameters in the request for
this task.
schema:
$ref: '#/definitions/order'
in: body
definitions:
order:
title: Order
description: A purchase order object
properties:
id:
type: integer
title: order id
description: identifier of an order
description:
type: string
title: Description
description: description of the order
lines:
type: array
items:
- type: string
- type: number

It doesn't seem to understand the lines array even though the swagger editor takes the above swagger as valid.

The error messages is:
Unable to build target: Could not process model 'order'.Please make sure that your schema is correct!
Details:
Object
code: 1
type: "error"
message: "Unable to build target: Could not process model 'order'.Please make sure that your schema is correct!"

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

No branches or pull requests

1 participant