Forum Discussion

frank_fjs's avatar
frank_fjs
Occasional Contributor
3 years ago

Resolved export create new models when I define bodies with object type schemas

Hi,

 

I was using the resolved export for swagger 2.0 to see what the final definition I get with the domains $ref substitution as I read in the SwaggeHub documentation

I assumed that these substitutions always work similar to parameter substitutions that put the code exactly at the $ref position, but I saw that the model definitions are generated in the definitions section and use the local $ref where the domain $ref was .

 

Ok in that point, but I think SwaggerHub documentation "Downloading OpenAPI Definitions" that say "Resolved means external links will resolved, that is, the contents of external files will be included in the resulting definition." isn't enough descriptive, specialy for next behavoir

 

My problem is, that for my surprise, when I describe a body schema (request or response) with object type and its properties, resolved export changes my swagger and creates new models with uncontroled names in definitions section too and use local $ref where I was my object type schema. And above documentation don't say nothing about it because only mention "external links" 

I don't like it because I only can control the model name in request body with its parameter name (but I don't like link parameter name and model name) and for response body is a weird composite name. It is a special problem when I want to define my "best practicies" and linter rules over final swagger definition

 

Is my Git push (with resolved option) going to do the same? I suppose yes

Is there a standard for that kind of resolved export?

Is any roadmap to offer different kind of resolved export?

 

Thanks in advance for the help

No RepliesBe the first to reply