-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add InputDescriptor.toRequestOptions #109
Add InputDescriptor.toRequestOptions #109
Conversation
|
||
representations.forEach { representation -> | ||
"${representation.name}: RequestOptions -> InputDescriptor -> RequestOptions quasi equality" { | ||
repeat(3) { |
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 repeat it three times?
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.
To get more permutations of requested attributes i.e. empty, all etc
} | ||
|
||
/** | ||
* Inverse operation of [RequestOptions.toInputDescriptor] |
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.
just add a little more documentation, i.e. when this would be needed?
@@ -121,6 +121,12 @@ data class RequestOptions( | |||
/** | |||
* Miscellaneous helper functions regarding [ConstraintField] | |||
*/ | |||
private fun Collection<ConstraintField>.toRequestedAttributes(): List<String> { | |||
val regex = "[a-zA-Z0-9_-]+".toRegex() | |||
val rawAttributes = this.map { constraint -> constraint.path.last().split("[").last() } |
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.
This seems it should be handled by JSON Path? / cc @acrusage-iaik
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.
since we cannot use schema-matching according to v2.0.0 or later this needs to be reworked.
Adds inverse operations to get back RequestOptions which were used to generate InputDescriptor.
This is useful if an incoming request needs to be manipulated.