-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat(clientapi): Return v2 test data #1514
Conversation
That's great, thank you. Will try to integrate the generated v2 values endpoint test data in dasch-swiss/dsp-js-lib#86 and then review this PR. |
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.
I cannot find test data for a create still image file value request.
That’s because there is no such request. A file value can only be created when creating a resource. |
Ok, I removed the unit test that would not have worked with Knora. |
I will think of a way to prevent clients from performing a create request for file values in the values endpoint. |
{"knora-api:error":"org.knora.webapi.NotFoundException: Value with UUID goZ7JFRNSeqF-dNxsqAS7Q not found (maybe you do not have permission to see it, or it is marked as deleted)","@context":{"knora-api":"http://api.knora.org/ontology/knora-api/v2#"}} |
Well, it’s a valid response, isn’t it? 😀 |
I like it! I am reloading my test data and will regenerate the code to rule out a local problem. |
RouteUtilV2.runRdfRouteWithFuture( | ||
requestMessageF = requestMessageFuture, | ||
requestContext = requestContext, | ||
settings = settings, | ||
responderManager = responderManager, | ||
log = log, | ||
targetSchema = targetSchema, | ||
schemaOptions = schemaOptions | ||
targetSchema = ApiV2Complex, |
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.
Would the simple schema be rejected?
settings = settings, | ||
responderManager = responderManager, | ||
log = log, | ||
targetSchema = ApiV2Complex, |
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.
Would the simple schema be rejected?
Yes. Added tests for this. |
This PR adds test requests and responses for the
/v2/values
route to the generated client API code.I refactored the values E2E tests to move the generation of JSON-LD into functions and constants into
SharedTestDataADM
, where they can be used both by E2E tests and by client code generation.I also refactored the TypeScript backend a bit to make the endpoint template easier to read.
Resolves #1513.