How to consume a OpenAPI (OAS v3) REST API

1
Hello, Is there a way to consume an OpenAPI (aka swagger) defined REST API in the way a SOAP interface can be consumed? The only option I see now is manually creating a model from example JSON messages and creating all the REST calls manually using the JSON as request/response bodies via an export/import mapping. This doesn’t seem to be the right way to do this as it denies all the information there is in the swagger.  
asked
2 answers
1

I fully agree that there is need to consume a REST api by using the OpenAPI specification instead of creating an input mapping from a sample JSON response.

The reason for this is that if you have a sample JSON then the sample response may be only partially populated. Also if the sample response contains an array entry of values than only the first array is taken into account

As a result only a part of the data model can be generated from a sample JSON response.

The current approach that Mendix is taking is a bit outdated. There if functionality needed to generate the data model based on the OpenAPI specification file.

Can you tell if this is somewhere on the Roadmap ?

answered
0

AFAIK there is no way currently to consume swagger documentation as sort of a wsdl analog of the SOAP web service.

You can however automate quite a bit by using the JSON examples in the swagger documentation and create json structures in Mendix. From the structures create the mappings and with the map automatically function the domain model will be created for you. This enhances the speed of development quite a bit, as many steps are automatically performed for you.

answered