-
Notifications
You must be signed in to change notification settings - Fork 531
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
Problems with references from external file to external or main file #304
Comments
More details, please. It's really not possible to help without a sample spec |
All files lie in the same folder. Composition works fine. Inheritance and InheritanceAndComposition don't. ReferenceToTheSameFile doesn't work either. swagger.json
parent.json
child.json
build.gradle
|
This should be fixed in the parser now. I'll ensure the codegen gets a reference to the snapshot here. |
Thanks a lot. Hope to try it as soon as I finish with my current task. |
Now it's not parsing the example above. I get "Exception in thread "main" java.lang.RuntimeException: Unable to load RELATIVE ref: ./child.json/swagger.json". Looks like it's trying to find one file into another and I haven't found a way to workaround it. |
URIs/URLs can be a pain. Try using |
Have tried. Exception in thread "main" java.lang.RuntimeException: Unable to load RELATIVE ref: ../parent.json. Gonna check further tomorrow. |
No, ../parent.json is not working for me. |
@Furion137 please ensure you're testing master. There are numerous tests to verify this working now |
@fehguy Have rechecked, I've been using the latest version from master. Does the example above work for you? |
@Furion137 I will add a test right now and report back |
@fehguy thanks a lot! |
Yes, looks like a bug--working on it, but you do have some circular references that may not be possible to use. I'll know more in a few. |
@fehguy thanks a lot! |
OK in your
You have an extra slash after the
and it works fine. Can you please retest and confirm? |
Thanks a lot! Looks like this way it works. Trying to rewrite our code this way. |
We have several POJO's we'd like to generate from yml/json using swagger-codegen. POJO's has modular structure and modules has dependencies between them. So we'd like to keep them in several json files and have "Parent" module absolutely independent, "Child1" module depending on "Parent", "Child2" depending on "Parent", "Grandchild1.1" depending on "Child1", etc. So we need inheritance and composition.
So for codegen it looks like swagger.yml with definition block filled with links to parent.json, child1.json, etc. The problem is that currently all the refs e.g. from "Child1" "./swagger.yml/#/definitions/BaseEntityDto" I've tried to use for inheritance are just ignored. And for composition it creates something like "SwaggerYmldefinitionsAddressTypeDto". Could you please take a look?
The text was updated successfully, but these errors were encountered: