How to add additional fields to contract definition #20
Unanswered
pablobiedma
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear all, I am a beginner using the connector and playing around with the 'Samples' tutorial. I am trying to add additional fields to a contract definition and I was wondering what the steps for doing this are.
Suppose we wanted to add a String field called
'test 1'
.This is what I've tried so far:
Adding such a field to the
contractoffer.json
fileAdding the field to the
ContractDefinition.java
class, creating a getter and a builder for it.I did the same for the
ContractOffer.java
classI also went to the
FileTransferExtension.java
class and added the field to theregisterContractDefinition
method:However, after requesting the offer catalog, this new field doesn't appear:
curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" -d @samples/04.0-file-transfer/contractdefinition.json [http://localhost:9192/api/v1/management/catalog/request](http://localhost:9192/api/v1/management/contractnegotiations)
{"id":"default","contractOffers":[{"id":"1:a8e4e903-e144-4c86-af1c-1e2c9cc4af62","policy":{"permissions":[{"edctype":"dataspaceconnector:permission","uid":null,"target":"test-document","action":{"type":"USE","includedIn":null,"constraint":null},"assignee":null,"assigner":null,"constraints":[],"duties":[]}],"prohibitions":[],"obligations":[],"extensibleProperties":{},"inheritsFrom":null,"assigner":null,"assignee":null,"target":"test-document","@type":{"@policytype":"set"}},"asset":{"id":"test-document","createdAt":1675675072827,"properties":{"asset:prop:byteSize":null,"asset:prop:id":"test-document","asset:prop:fileName":null}},"provider":"urn:connector:provider","consumer":"urn:connector:consumer","offerStart":null,"offerEnd":null,"contractStart":"2023-02-06T10:17:52.8+01:00","contractEnd":"2023-02-06T10:17:52.8Z"}]}%
How can I add such a field to a contract?
Thank you for your help, it's really appreciated :)
Beta Was this translation helpful? Give feedback.
All reactions