-
Notifications
You must be signed in to change notification settings - Fork 119
Expose schemaPath for external schemas #520
Conversation
| ResolvedType resolvedType = getResolvedType(); | ||
| if (resolvedType instanceof AbstractExternalType) | ||
| { | ||
| if (!((AbstractExternalType) resolvedType).getSchemaPath().equalsIgnoreCase(ARTIFICIAL_NODE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, removed
|
|
||
| import static org.hamcrest.CoreMatchers.instanceOf; | ||
| import static org.hamcrest.core.Is.is; | ||
| import static org.junit.Assert.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use import * and remove unused ones, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, removed.
|
|
||
| Api apiV10 = ramlModelResult.getApiV10(); | ||
|
|
||
| Assert.assertTrue(((XMLTypeDeclaration) apiV10.resources().get(0).methods().get(0).body().get(0)).schemaPath().endsWith("person-schema.xsd")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Also replaced the logic used to get the schemaPath on ExternalSchemaTypeExpressionNode.java <-- Please review this