-
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
Are external references supported? #1774
Comments
Looks related to go-openapi/validate#102, although I don't know how the templates you are using are calling this (standard templates don't use dynamic schema validation). |
Hi, I get a similar issue. Here is my folders :
In When I run But when I run Am I doing something wrong? Or is it related to this issue? |
This is a different kind of issue. Specs served with |
Oh ! thx for the tips ! |
* 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>
* 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>
It may have some relation to #1767, but since the diagnostic is a bit different, I opened a new issue.
Problem statement
When one tries to use
$ref
, pointing to another file (residing locally) as shown in the gist (everything is in adef
directory, api.yaml, Data.yaml, ...), go-openapi calls a panic at runtime:The panic message prints out a wrong path (it must be not at the path where
main.go
resides and which basically represents thepwd
, but ratherpkg/api/rest/def
). But even if it were the right path, it is still weird. What I usually distribute, is an executable, not the entire design-time stuff. And YAML API definitions are rather design time, aren't they? How a compiled executable should find them after the distribution?So, my question is, do you (go-swagger and/or go-openapi) support this scenario at all? I have not found any tests that verify that.
After having put all references inside the file (
#/definitions
etc) everything works just fine.Swagger specification
See gist. It is a collection of files, all residing in a
def
directorySteps to reproduce
swagger generate server --spec=pkg/api/rest/def/api.yaml --model-package=dto --template=stratoscale --template-dir=pkg/api/rest/templates --name=UserService --target=pkg/api/rest/gen --exclude-main --with-flatten=full
Yes, it is custom templates. If you want me to redo it with default templates, please let me know.
Environment
swagger version: 0.17.0
go version: 1.11
OS: Windows 10 (Linux Subsystem/Ubuntu 18.04)
The text was updated successfully, but these errors were encountered: