REST Connector / Swagger 2.0 (OAS) handling of object references that can be objects or can be null.

I'm in need of your assistance once again :-)

 

I have another issue with the Scribe Online REST connector and the way that it interprets object references that can be an object or can be null.

 

There is widespread discussion on the Internet around the support for nullable types in Swagger 2.0 (or rather lack of), and also associated discussion around the use of anyOf,allOf,oneOf when defining schema definitions.

 

I am looking for some help in being able to define the correct way in Swagger 2.0 for use by the Scribe Online REST Connector to define an object reference that can be an object or can be null.

 

The error that Scribe Online throws is:

 

This is not because the object reference isn't defined in the Swagger. See below:

 

This appears to be because, Scribe Online isn't interpreting the response data correctly.

 

This is a subset of the JSON returned from the web service with payment terms defined:

 

And an example of a customer record where the payment terms reference is null.

 

Interestingly, the error that is thrown refers to the next token in the JSON response (shipmentMethod) as visible above. This I believe is because Scribe Online isn't interpreting the previous object reference properly as I'm unable to define multi-type options in the Swagger.

 

The shipmentMethod is defined in the Swagger spec.

 

So, in summary I'm really after a supported way of defining an object reference that can be null in Swagger 2.0 that will allow Scribe Online to interpret the object reference or null properly.

 

Any ideas warmly received!

 

KR,

 

IW

 

 

 

(2) Answers

Login