-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One spec in multiple files (data types logic override) - error of generating #1767
Comments
interesting use case. Looks like a bug in go-openapi/analysis to flatten this spec. You could try moving your ext references from responses to definitions, it might help. |
Mmhhh. Tried to play a bit with this spec. Problem lays with circular ref formed by several files. We still have a problem in go-openapi/spec with such circulars. Try defining the cycle in one single file. |
If i describe "Patient" object in "definitions" zone then i get error
Because one schema using in body and in responses So in Identifier.yaml i set the value for reference type like full description object
But when i'm trying to generate - return's me same runtime error |
* Acknowleges go-swagger/go-swagger#1774 Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* Acknowleges go-swagger/go-swagger#1774 Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Works with the fix mentioned above. Please mark that this requires |
* fixes go-swagger#1796 * fixes go-swagger#1774 * fixes go-swagger#1767 Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* fixes go-swagger#1796 * fixes go-swagger#1774 * fixes go-swagger#1767 Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* fixes go-swagger#1796 * fixes go-swagger#1774 * fixes go-swagger#1767 Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* fixes go-swagger#1796 * fixes go-swagger#1774 * fixes go-swagger#1767 Updates vendor from go-openapi/analysis Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* fixes go-swagger#1796 * fixes go-swagger#1774 * fixes go-swagger#1767 Updates vendor from go-openapi/analysis Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* fixes go-swagger#1796 * fixes go-swagger#1774 * fixes go-swagger#1767 Updates vendor from go-openapi/analysis Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* fixes go-swagger#1796 * fixes go-swagger#1774 * fixes go-swagger#1767 Updates vendor from go-openapi/analysis Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* fixes go-swagger#1796 * fixes go-swagger#1774 * fixes go-swagger#1767 Updates vendor from go-openapi/analysis Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Problem statement
runtime error - when try to generate spec with several files
Swagger specification
For example i separate one file to several minimal files
api.swagger.yaml
Object (patient) describes in different file
Patient.yaml
Patient has Identifier which exist in another file
Identifier.yaml
Identifier has field with type Reference which describes like
Reference.yaml
One interesting thing than Reference has one field type of Identifier
all types in this example equal logic data types of FHIR format
Steps to reproduce
let's try to generate server
return error
Maybe this datatypes looks like something strange
Patient -> Identifier -> Reference -> Identifier - but this is standard
When all datatypes describes in one swagger file - all works ok but for more usability need to separate by several files
If in Reference description change type 'Identifier.yaml' for example - on string type - all generated good
How it can be fixed?
Thanks!
Environment
swagger version: 0.16.0
go version: 1.10.3
OS: mojave 10.14
The text was updated successfully, but these errors were encountered: