You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.
I was wondering if there has been any resolution to the issue presented here: swagger-api/swagger-ui#463
Recap of above link:
Using swagger-node-express there seems to be a nesting cap of 1 layer deep. E.G. If you use a model within a model, the second model will not be loaded and not appear in neither swagger-ui nor in the raw JSON output that describes the API and its models.
I believe that this is more of a swagger-node-express issue due to the JSON output not containing the second layered model as expected.
It seems that this issue may be related as well: #85
exports.models = {
"projectWithSource":{
"id":"projectWithSource",
"properties":{
"project_id":{
"type":"integer",
"format": "int32",
"description": "Unique id for the project"
},
"name":{
"type":"string",
"description":"Unique name for the project"
},
"description":{
"type":"string",
"description":"Description of the project. Can be an empty string."
},
"created-date":{
"type":"string",
"format":"date-time",
"description":"Date the project was created"
},
"created_source":{
"type":"string",
"description":"Source from which the project was created"
}
},
"required":[
"project_id",
"name",
"description",
"created-date",
"created_source"
]
},
"projectReturn":{
"id":"projectReturn",
"properties":{
"data":{
"type":"array",
"items":{
"$ref":"projectWithSource"
}
},
"count":{
"type":"integer",
"format": "int32",
"description":"How many responses were found"
},
"success":{
"type":"string",
"description":"true or false"
}
},
"required":[
"data",
"count",
"success"
]
},
"newProjectObj":{
"id":"newProjectObj",
"properties":{
"projectObj":{
"$ref":"projectReturn"
},
"customAttr":{
"type":"array",
"description":"Array of custom defined attributes",
"items":{
}
}
},
"required":[
"projectObj",
"customAttr"
]
}
};
The above result shows as the following in swagger-ui:
The JSON representation given by swagger-node-express is as follows:
{
apiVersion:"0.0.1",
swaggerVersion:"1.2",
basePath:"http://localhost:8002",
resourcePath:"/newProjectService",
description:"(NewProject) - Project folder/file creation",
apis:[
{
path:"/newProjectService",
operations:[
{
method:"POST",
summary:"Helps create a new Project",
notes:"Creates a project folder with template '.xlsm' and '.csv' files for the client to input their custom data.",
parameters:[
{
paramType:"body",
name:"body",
description:"projectObj properties to be updated",
type:"newProjectObj",
required:true
}
],
type:"success",
nickname:"newProject",
responseMessages:[
{
code:404,
message:" not found"
}
]
}
]
}
],
models:{
newProjectObj:{
id:"newProjectObj",
properties:{
projectObj:{
$ref:"projectReturn"
},
customAttr:{
type:"array",
description:"Array of custom defined attributes",
items:{
}
}
},
required:[
"projectObj",
"customAttr"
]
},
success:{
id:"success",
properties:{
success:{
type:"string",
description:"True or False"
}
},
required:[
"success"
]
},
projectReturn:{
id:"projectReturn",
properties:{
data:{
type:"array",
items:{
$ref:"projectWithSource"
}
},
count:{
type:"integer",
format:"int32",
description:"How many responses were found"
},
success:{
type:"string",
description:"true or false"
}
},
required:[
"data",
"count",
"success"
]
}
}
}
Conclusion - As you can see, the model 'projectWithSource' is missing.
If you refer back to swagger-api/swagger-ui#463 and look at my comment at the bottom, the model will load as long as some other property has a link to it that is 1 layer deep.
If anyone has any advice on whether this is a bug, or I am not doing this correctly, please let me know. Thanks.
The text was updated successfully, but these errors were encountered:
the cap for nesting is really about recursion and duplication of the same model type. So I believe it's working as designed--please post any UI feedback into the swagger-ui project.
Hello swagger users,
I was wondering if there has been any resolution to the issue presented here: swagger-api/swagger-ui#463
Recap of above link:
Using swagger-node-express there seems to be a nesting cap of 1 layer deep. E.G. If you use a model within a model, the second model will not be loaded and not appear in neither swagger-ui nor in the raw JSON output that describes the API and its models.
I believe that this is more of a swagger-node-express issue due to the JSON output not containing the second layered model as expected.
It seems that this issue may be related as well: #85
Example (example given in swagger-api/swagger-ui#463 is very similar):
newProjectObject references projectReturn which then references projectWithSource
newProjectObject -> projectReturn -> projectWithSource
The above result shows as the following in swagger-ui:
The JSON representation given by swagger-node-express is as follows:
Conclusion - As you can see, the model 'projectWithSource' is missing.
If you refer back to swagger-api/swagger-ui#463 and look at my comment at the bottom, the model will load as long as some other property has a link to it that is 1 layer deep.
If anyone has any advice on whether this is a bug, or I am not doing this correctly, please let me know. Thanks.
The text was updated successfully, but these errors were encountered: