web stats
Mirth API Swagger 'optional'? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2019, 11:30 PM
flcdrg flcdrg is offline
What's HL7?
 
Join Date: Nov 2015
Posts: 3
flcdrg is on a distinguished road
Default Mirth API Swagger 'optional'?

All the fields in the model are listed as optional, but it seems if I leave any of them out, the API returns 500 (and seems to log NullPointerExceptions on the back end).

Attached Images
File Type: png Untitled.png (51.9 KB, 6 views)
Reply With Quote
  #2  
Old 10-10-2019, 10:08 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,005
agermano is on a distinguished road
Default

Even though swagger shows examples in javascript, the server expects xml. You'll notice that the parameter content type drop down only allows you to select "application/xml."

If you GET /channels, the xml returned is in the same format that your POST body needs to be.
Reply With Quote
  #3  
Old 10-10-2019, 03:55 PM
flcdrg flcdrg is offline
What's HL7?
 
Join Date: Nov 2015
Posts: 3
flcdrg is on a distinguished road
Default

Yeah, I figured that out.

So would it be reasonable for the Swagger definitions be fixed so that it is defining all those fields as required instead of optional (assuming that they are all indeed required)? It looks like the current definitions are incomplete otherwise.

I've also had some errors raised when I try to import the swagger.json file into some other systems (implying that there's some incorrect or missing values)
Reply With Quote
Reply

Tags
api, swagger

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:28 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation