cancel
Showing results for 
Search instead for 
Did you mean: 

Third party DTO as schema reference

New Contributor

Third party DTO as schema reference

Is there a way to set, as schema definition, a DTO defined in a java DTO .class?

requestBody:
content:
application/json:
schema:
$ref: '#/path.to.my.java.class.located.in.a.jar'

 

2 REPLIES 2
Moderator

Re: Third party DTO as schema reference

A reference needs to be a valid URI, so technically if your jar is accessible, it could work. However, it's unlikely that the different resolvers would be able to make sense of it. Of course, the expectation that the reference would lead to a JSON Schema, otherwise it's completely meaningless.

New Contributor

Re: Third party DTO as schema reference

Hi Ron.

I found out that if you reference the class with quotes, it works

Ie: 

$ref: 'MyPOJO'

if MyPOJO is present in the proyect classpath, it works 

New Here?
Join us and watch the welcome video:
API Testing Mistake #2
APITestingMistake#2
Top Kudoed Authors