My Products
Help
Véronique
CONTRIBUTOR **

Swagger file doesn't describe attachment endpoints properly

by Véronique (Updated ‎05-02-2021 18:50 by Yıldırım VISMA )

Hello,

We use the Swagger file to generate our API client with AutoRest.

We had to make a few manual changes to the Swagger file so it follows the specifications in order for AutoRest to generate the proper signatures with a Stream as a parameter or return type.

 

For endpoint GET /controller/api/v1/attachment/{attachmentId} we had to:

  • Change the "produces" array to ["application/octet-stream"]
  • Change the value of responses.200.schema.type to "file"

For endpoint POST /controller/api/v1/expenseReceipt/{receiptNumber}/attachment we had to:

  • Change the "consumes" array to ["multipart/form-data"]
  • Add an extra entry in the "parameters" array {"name":"file","in":"formData","description":"The file to upload and attach to the expense receipt","required":true,"type":"file"}

I would be grateful if you could fix the Swagger file so we don't have to make these manual changes every time we are going to upgrade our API client.

Also, with these changes it would be possible to upload files directly from the Swagger documentation when trying out the endpoints.

3 REPLIES 3
Yıldırım
VISMA

by Yıldırım (Updated ‎15-02-2021 15:12 by Yıldırım VISMA )

Hello Véronique,

I see your point. 
swagger_json.pngswagger_json2.png

We'll check this out with the team to make sure source file produces the correct definitions. 



@Véronique wrote:

Also, with these changes it would be possible to upload files directly from the Swagger documentation when trying out the endpoints.


This improvement request is in our backlog. We'll update the case in the ideas section when we receive further information.

Thanks.

any update on this?

 

How about if Visma provide a visma net client api for most common code languages? I have tried nswag which is an opensource project for creating client apis which is also built into Visual studio, but the VN swagger json does not seem to be compatible. 

 

 

Yıldırım
VISMA

Hello, 

 

this is in the backlog and unfortunately, we're unable to share specific information about the release plan at the moment since it's not emerged yet. We'll continue to keep you informed of further developments as we receive information on any progress.