0

I am creating API documentation utilizing Swagger UI. I have many errors that say "Not a valid parameter definition" and I don't know why. Can anyone tell what or why this is happening? I include a section of the code and a picture with the line numbers and the error descriptions.

swagger example

#sys_application /api/application/add: post: description: Adds specified application(s). parameters: - name: name in: body description: name of the application required: true type: string - name: appId in: body description: application id required: true type: string - name: icon in: body description: application icon required: true type: string - name: state in: body description: current state of the application required: true type: string - name: profileRoute in: body description: embedded profile route that is displayed within the map app required: true type: string - name: type in: body description: type of the application required: true type: string - name: permissions in: body description: user permissions for application required: false type: string - name: subscriptions in: body description: application subscriptions required: false type: string 

swagger error

enter image description here

1 Answer 1

2

when you use in: body, the spec expects a schema element, such as:

name: user in: body schema: type: object properties: userId: type: string 

If you're not using a body parameter, you are expected to use a primitive value, such as type: string.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.