fix relative ref with http ref bug#806
Conversation
| } | ||
|
|
||
| @Test | ||
| public void testRelativeRefIncludingUrlRef(@Injectable final Schema mockedModel) { |
There was a problem hiding this comment.
This requires a server call to https://raw.githubusercontent.com/. Please mock it in the unit tests.
|
The change looks good to me, but your new unit test requires a server call to Add a new parameter: final String url = "https://raw.githubusercontent.com/swagger-api/swagger-parser/v2.0.2/modules/swagger-parser-v3/src/test/resources/relative/globals.yaml";
final String expectedResult = "components:\n" +
" schemas:\n" +
" link-object:\n" +
" type: object\n" +
" additionalProperties:\n" +
" \"$ref\": \"#/components/schemas/rel-data\"\n" +
" rel-data:\n" +
" type: object\n" +
" required:\n" +
" - href\n" +
" properties:\n" +
" href:\n" +
" type: string\n" +
" note:\n" +
" type: string\n" +
" result:\n" +
" type: object\n" +
" properties:\n" +
" name:\n" +
" type: string\n" +
" _links:\n" +
" \"$ref\": \"#/components/schemas/link-object\"\n" +
"";
List<AuthorizationValue> auths = null;
new Expectations() {{
RemoteUrl.urlToString(url, auths);
times = 1;
result = expectedResult;
}};Second question: |
|
Thanks for the review, and fine example to support this PR. |
|
I added a test to confirm that "./" is still attached to relative local ref file. |
|
I am not owner of this project, but this PR looks good to me. Thank you a lot for this contribution |
Port pull request swagger-api#806
|
Thanks for this PR @fujigon |
|
@gracekarina I ran into this issue in the 2.0.2 release and was about to file an issue, when I see it has been fixed here. Do you have a timeline for the 2.0.3 release with this fix? Thanks! |
|
hi @douglasbgray the current plan is to release in a couple of weeks. |
This patch fixes #805.