swagger_parser
swagger_parser copied to clipboard
References to other files are not properly mapped
Hi,
I have this environment with multiple json files that have parts of models (for example, various enumerations in one file, and the usage of those enumeration in another file). Those interfile references are not being mapped for json decoding.
Example enumeration file (service_enumerations.json):
{
"openapi": "3.0.1",
"info": {
"title": "Service Enumerations",
"version": "1.0"
},
"components": {
"schemas": {
"LogLevel": {
"type": "string",
"enum": [
"Trace",
"Debug",
"Information",
"Warning",
"Error",
"Critical",
"None"
]
},
}
}
}
Example usage (service.json):
{
"openapi": "3.0.1",
"info": {
"title": "Service",
"version": "1.0"
},
"components": {
"schemas": {
"CreateSessionParameters": {
"required": [
"sessionType"
],
"type": "object",
"properties": {
"sessionType": {
"$ref": "service_enumerations.json#/components/schemas/SessionTypes"
}
}
}
}
}
}
I would expect the json encoding and decoding to be in the session_types.dart file but they are not there. Also the CreateSessionParameters doesn't seem to be able to create the fromJson for the SessionTypes