Skip to main content

datacontract edit

Edit a data contract file in the Data Contract Editor (web UI). Starts a local web server that opens the Data Contract Editor for the given file. The editor is bundled with the CLI, so no internet access is required. Saving in the editor writes directly back to the local file. If a URL is given, you are asked whether to download a local copy, which is then edited. The server also acts as the editor's test runner: "Run test" in the editor executes the data contract tests locally against the servers defined in the data contract. Credentials for the data sources must be provided as environment variables, see https://cli.datacontract.com/#test

datacontract edit [OPTIONS] [LOCATION]
ArgumentDefaultDescription
[LOCATION]datacontract.yamlThe path of the data contract yaml to edit. If the file does not exist, you are asked whether to initialize a new data contract. If a URL is given, you are asked whether to download a local copy to edit.
OptionDefaultDescription
--port4243Bind socket to this port.
--host127.0.0.1Bind socket to this host. Hint: For running in docker, set it to 0.0.0.0
--editor-versionVersion of the datacontract-editor npm package to load from the CDN, e.g. '0.1.9' or 'latest'. By default, the editor version bundled with the CLI is used (works offline).
--editor-assets-urlBase URL to load the Data Contract Editor assets (JS/CSS) from, e.g. a self-hosted editor build. Takes precedence over --editor-version.
--open / --no-open--openOpen the editor in the default browser.
--debug / --no-debugEnable debug logging
datacontract edit datacontract.yaml

Guide: Edit your Contract.