This repository was archived by the owner on Feb 12, 2022. It is now read-only.
Expose schemaPath for external schemas#520
Merged
pacafuentes merged 4 commits intomasterfrom Jul 6, 2018
Merged
Conversation
dfmacias
suggested changes
Jul 4, 2018
| ResolvedType resolvedType = getResolvedType(); | ||
| if (resolvedType instanceof AbstractExternalType) | ||
| { | ||
| if (!((AbstractExternalType) resolvedType).getSchemaPath().equalsIgnoreCase(ARTIFICIAL_NODE)) |
Contributor
There was a problem hiding this comment.
Why did you add this check?
Contributor
Author
There was a problem hiding this comment.
No reason, I can remove it if you want.
I thought it was not right to expose that string to the user
| import javax.annotation.Nullable; | ||
| import javax.json.JsonObject; | ||
|
|
||
| import org.apache.commons.lang.StringUtils; |
|
|
||
| import static org.hamcrest.CoreMatchers.instanceOf; | ||
| import static org.hamcrest.core.Is.is; | ||
| import static org.junit.Assert.*; |
Contributor
There was a problem hiding this comment.
Don't use import * and remove unused ones, please
Contributor
Author
There was a problem hiding this comment.
Done, removed.
|
|
||
| Api apiV10 = ramlModelResult.getApiV10(); | ||
|
|
||
| Assert.assertTrue(((XMLTypeDeclaration) apiV10.resources().get(0).methods().get(0).body().get(0)).schemaPath().endsWith("person-schema.xsd")); |
Contributor
There was a problem hiding this comment.
A better approach would be checking if schema path is right compared with raml path src/test/resources/org/raml/v2/api/v10/xml-external/input.raml
pacafuentes
approved these changes
Jul 6, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also replaced the logic used to get the schemaPath on ExternalSchemaTypeExpressionNode.java <-- Please review this