-
Notifications
You must be signed in to change notification settings - Fork 79
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
Validate http routing object configuration. #403
Validate http routing object configuration. #403
Conversation
components/common/src/main/java/com/hotels/styx/config/schema/Schema.java
Show resolved
Hide resolved
|
||
private Optional<String> message(List<String> parents, JsonNode tree) { | ||
String fullName = Joiner.on(".").join(parents); | ||
return Optional.of(format("Unexpected field type. Field '%s' should be MAP ('%s'), but it is %s", fullName, this.elementType().describe(), tree.getNodeType())); |
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.
*Here why I decided to add the comment to remove hardcoded strings for the field type. Still a minor issue of course...
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.
The element type can be anything. Even a nested map. For this reason the describe()
is really important. If I understood your comment correctly? :-)
components/common/src/main/java/com/hotels/styx/config/schema/Schema.java
Outdated
Show resolved
Hide resolved
components/common/src/main/java/com/hotels/styx/config/schema/Schema.java
Outdated
Show resolved
Hide resolved
components/common/src/main/java/com/hotels/styx/config/schema/Schema.java
Outdated
Show resolved
Hide resolved
components/common/src/main/java/com/hotels/styx/config/schema/Schema.java
Outdated
Show resolved
Hide resolved
components/common/src/main/java/com/hotels/styx/config/schema/Schema.java
Outdated
Show resolved
Hide resolved
components/common/src/test/java/com/hotels/styx/config/validator/DocumentFormatTest.java
Outdated
Show resolved
Hide resolved
components/common/src/test/java/com/hotels/styx/config/validator/DocumentFormatTest.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/ServerConfigSchema.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/config/RoutingObjectFactory.java
Outdated
Show resolved
Hide resolved
components/proxy/src/test/kotlin/com/hotels/styx/ServerConfigSchemaTest.kt
Outdated
Show resolved
Hide resolved
66fa1f5
to
a251d3b
Compare
…res. Move unit tests from DocumentFormatTest into SchemaTest.
Add capability to validate built-in HTTP routing object configurations.
Refactor config schema validator.