I'm following the exact steps in the official getting started guide: https://developer.ibm.com/apiconnect/getting-started/create-your-api/, but when I reach the point of publishing to Bluemix, I get the following error:
And in the console:
Is everyone getting that error? any ideas how to fix?
Answer by FXPanaget (658) | Apr 27, 2016 at 10:07 AM
Hi Jesus,
You have an error in your swagger definition. What is the validation saying? If there are warning or errors, there should be an icon next to the save button in the Designer helping you to get to where the warning or error comes from (such as below):
Did you add a property or change anything in your generated model?
On my environment the change-stream path has the following:
What do you see for the responses ? In some case I have seen that the validation does not flag an error if the response for an operation does not correspond to a valid schema type (usually the UI will show an empty value for the response schema field). Make sure that it is not the case for you.
Hope that will help you.
Regards, François
Answer by JesúsCarrera (1) | Apr 27, 2016 at 05:35 PM
You are right I get that warning in the designer:
It seems that the error is related to the x-any definition.
I did not change anything, just followed the getting started guide step by step and it created the x-any definition. Can you explain what is that for? Should I just remove it?
Hi Jesus The related to the x-any definition validation warning is to be ignored. It will not prevent the publishing. You can remove it but it will not help.
On the other hand, I see that in the responses for the operation(s) before note.greet (likely for the /notes/change-stream path) are of type File while it should be object or string instead of file.
You should have something like:
/notes/change-stream:
post:
tags:
- note
summary: Create a change stream.
operationId: note.createChangeStream__post_notes_change-stream
parameters:
- name: options
in: formData
required: false
type: string
format: JSON
responses:
'200':
description: Request was successful
schema:
type: object
deprecated: false
Regards, François
Answer by JesúsCarrera (1) | May 04, 2016 at 08:15 AM
Hi François, that was the issue, thanks!
Can't run loopback app with DataPower through API Designer 0 Answers
Best practice while using IBM API Connect? 1 Answer
debug tail file command in API Manager 1 Answer
Developer portal REST APIs for analytics data about API, Plan, and application usage? 1 Answer
Strongloop LoopBack Change-Stream puts terms in its response before JSON? 1 Answer