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.
Ticket
This PR covers two tickets:
What are you trying to accomplish?
Block users from changing subjects that were automatically set because of the WP type's configuration.
Screenshots
What approach did you choose and why?
Changing the schema response for
writable
dynamically, based on whether the WP type has a subject pattern defined or not. This is already respected by our own table views and also allows third party clients to recognize that the subject can't be changed.Admittedly, I was unsure about how "deep" I should define the attribute as non-writable. I've now chosen the
WorkpackageSchemaRepresenter
, where my other options would have been to do it on the work package schema (probablySpecificWorkPackageSchema
, because that one knows the type) or maybe even the create and update contracts.Merge checklist