Chapter 3. Managing Apicurio Registry content using the web console You can manage schema and API artifacts stored in Apicurio Registry by using the Apicurio Registry web console. This includes uploading and browsing Apicurio Registry content, configuring optional rules for content, and generating client sdk code: Section 3.1, "Viewing artifacts using the Apicurio Registry web console" Section 3.2, "Adding artifacts using the Apicurio Registry web console" Section 3.3, "Configuring content rules using the Apicurio Registry web console" Section 3.4, "Generating client SDKs for OpenAPI artifacts using the Apicurio Registry web console" Section 3.5, "Changing an artifact owner using the Apicurio Registry web console" Section 3.6, "Configuring Apicurio Registry instance settings using the web console" Section 3.7, "Exporting and importing data using the Apicurio Registry web console" 3.1. Viewing artifacts using the Apicurio Registry web console You can use the Apicurio Registry web console to browse the schema and API artifacts stored in Apicurio Registry. This section shows a simple example of viewing Apicurio Registry artifacts, groups, versions, and artifact rules. Prerequisites Apicurio Registry is installed and running in your environment. You are logged in to the Apicurio Registry web console: http://MY_REGISTRY_URL/ui Artifacts have been added to Apicurio Registry using the web console, command line, Maven plug-in, or a Java client application. Procedure On the Artifacts tab, browse the list of artifacts stored in Apicurio Registry, or enter a search string to find an artifact. You can select from the list to search by specific criteria such as name, group, labels, or global ID. Figure 3.1. Artifacts in Apicurio Registry web console Click an artifact to view the following details: Overview : Displays artifact version metadata such as artifact name, artifact ID, global ID, content ID, labels, properties, and so on. Also displays rules for validity and compatibility that you can configure for artifact content. Documentation (OpenAPI and AsyncAPI only): Displays automatically-generated REST API documentation. Content : Displays a read-only view of the full artifact content. For JSON content, you can click JSON or YAML to display your preferred format. References : Displays a read-only view of all artifacts referenced by this artifact. You can also click View artifacts that reference this artifact . If additional versions of this artifact have been added, you can select them from the Version list in page header. To save the artifact contents to a local file, for example, my-openapi.json or my-protobuf-schema.proto , and click Download at the end of the page. Additional resources Section 3.2, "Adding artifacts using the Apicurio Registry web console" Section 3.3, "Configuring content rules using the Apicurio Registry web console" Chapter 10, Apicurio Registry content rule reference 3.2. Adding artifacts using the Apicurio Registry web console You can use the Apicurio Registry web console to upload schema and API artifacts to Apicurio Registry. This section shows simple examples of uploading Apicurio Registry artifacts and adding new artifact versions. Prerequisites Apicurio Registry is installed and running in your environment. You are logged in to the Apicurio Registry web console: http://MY_REGISTRY_URL/ui Procedure On the Artifacts tab, click Upload artifact , and specify the following details: Group & ID : Use the default empty settings to automatically generate an artifact ID and add the artifact to the default artifact group. Alternatively, you can enter an optional artifact group name or ID. Type : Use the default Auto-Detect setting to automatically detect the artifact type, or select the artifact type from the list, for example, Avro Schema or OpenAPI . You must manually select the Kafka Connect Schema artifact type, which cannot be automatically detected. Artifact : Specify the artifact location using either of the following options: From file : Click Browse , and select a file, or drag and drop a file. For example, my-openapi.json or my-schema.proto . Alternatively, you can enter the file contents in the text box. From URL : Enter a valid and accessible URL, and click Fetch . For example: https://petstore3.swagger.io/api/v3/openapi.json . Click Upload and view the artifact details: Overview : Displays artifact version metadata such as artifact name, artifact ID, global ID, content ID, labels, properties, and so on. Also displays rules for validity and compatibility that you can configure for artifact content. Documentation (OpenAPI and AsyncAPI only): Displays automatically-generated REST API documentation. Content : Displays a read-only view of the full artifact content. For JSON content, you can click JSON or YAML to display your preferred format. References : Displays a read-only view of all artifacts referenced by this artifact. You can also click View artifacts that reference this artifact . You can add artifact references using the Apicurio Registry Maven plug-in or REST API only. The following example shows an example OpenAPI artifact: Figure 3.2. Artifact details in Apicurio Registry web console On the Overview tab, click the Edit pencil icon to edit artifact metadata such as name or description. You can also enter an optional comma-separated list of labels for searching, or add key-value pairs of arbitrary properties associated with the artifact. To add properties, perform the following steps: Click Add property . Enter the key name and the value. Repeat the first two steps to add multiple properties. Click Save . To save the artifact contents to a local file, for example, my-protobuf-schema.proto or my-openapi.json , click Download at the end of the page. To add a new artifact version, click Upload new version in the page header, and drag and drop or click Browse to upload the file, for example, my-avro-schema.json or my-openapi.json . To delete an artifact, click Delete in the page header. Warning Deleting an artifact deletes the artifact and all of its versions, and cannot be undone. Additional resources Section 3.1, "Viewing artifacts using the Apicurio Registry web console" Section 3.3, "Configuring content rules using the Apicurio Registry web console" Chapter 10, Apicurio Registry content rule reference 3.3. Configuring content rules using the Apicurio Registry web console You can use the Apicurio Registry web console to configure optional rules to prevent invalid or incompatible content from being added to Apicurio Registry. All configured artifact-specific rules or global rules must pass before a new artifact version can be uploaded to Apicurio Registry. Configured artifact-specific rules override any configured global rules. This section shows a simple example of configuring global and artifact-specific rules. Prerequisites Apicurio Registry is installed and running in your environment. You are logged in to the Apicurio Registry web console: http://MY_REGISTRY_URL/ui Artifacts have been added to Apicurio Registry using the web console, command line, Maven plug-in, or a Java client application. When role-based authorization is enabled, you have administrator access for global rules and artifact-specific rules, or developer access for artifact-specific rules only. Procedure On the Artifacts tab, browse the list of artifacts in Apicurio Registry, or enter a search string to find an artifact. You can select from the list to search by specific criteria such as artifact name, group, labels, or global ID. Click an artifact to view its version details and content rules. In Artifact-specific rules , click Enable to configure a validity, compatibility, or integrity rule for artifact content, and select the appropriate rule configuration from the list. For example, for Validity rule , select Full . Figure 3.3. Artifact content rules in Apicurio Registry web console To access global rules, click the Global rules tab. Click Enable to configure global validity, compatibility, or integrity rules for all artifact content, and select the appropriate rule configuration from the list. To disable an artifact rule or global rule, click the trash icon to the rule. Additional resources Section 3.2, "Adding artifacts using the Apicurio Registry web console" Chapter 10, Apicurio Registry content rule reference 3.4. Generating client SDKs for OpenAPI artifacts using the Apicurio Registry web console You can use the Apicurio Registry web console to configure, generate, and download client software development kits (SDKs) for OpenAPI artifacts. You can then use the generated client SDKs to build your client applications for specific platforms based on the OpenAPI. Apicurio Registry generates client SDKs for the following programming languages: C# Go Java PHP Python Ruby Swift TypeScript Note Client SDK generation for OpenAPI artifacts runs in your browser only, and cannot be automated by using an API. You must regenerate the client SDK each time a new artifact version is added in Apicurio Registry. Prerequisites Apicurio Registry is installed and running in your environment. You are logged in to the Apicurio Registry web console: http://MY_REGISTRY_URL/ui An OpenAPI artifact has been added to Apicurio Registry using the web console, command line, Maven plug-in, or a Java client application. Procedure On the Artifacts tab, browse the list of artifacts stored in Apicurio Registry, or enter a search string to find a specific OpenAPI artifact. You can select from the list to search by criteria such as name, group, labels, or global ID. Click the OpenAPI artifact in the list to view its details. In the Version metadata section, click Generate client SDK , and configure the following settings in the dialog: Language : Select the programming language in which to generate the client SDK, for example, Java . Generated client class name : Enter the class name for the client SDK, for example, MyJavaClientSDK. Generated client package name : Enter the package name for the client SDK, for example, io.my.example.sdk Click Show advanced settings to configure optional comma-separated lists of path patterns to include or exclude: Include path patterns : Enter specific paths to include when generating the client SDK, for example, **/.*, **/my-path/* . If this field is empty, all paths are included. Exclude path patterns : Enter specific paths to exclude when generating the client SDK, for example, **/my-other-path/* . If this field is empty, no paths are excluded. Figure 3.4. Generate a Java client SDK in Apicurio Registry web console When you have configured the settings in the dialog, click Generate and download . Enter a file name for the client SDK in the dialog, for example, my-client-java.zip , and click Save to download. Additional resources Apicurio Registry uses Kiota from Microsoft to generate the client SDKs. For more information, see the Kiota project in GitHub . For more details and examples of using the generated SDKs to build client applications, see the Kiota documentation . 3.5. Changing an artifact owner using the Apicurio Registry web console As an administrator or as an owner of a schema or API artifact, you can use the Apicurio Registry web console to change the artifact owner to another user account. For example, this feature is useful if the Artifact owner-only authorization option is set for the Apicurio Registry instance on the Settings tab so that only owners or administrators can modify artifacts. You might need to change owner if the owner user leaves the organization or the owner account is deleted. Note The Artifact owner-only authorization setting and the artifact Owner field are displayed only if authentication was enabled when the Apicurio Registry instance was deployed. For more details, see Installing and deploying Red Hat build of Apicurio Registry on OpenShift . Prerequisites The Apicurio Registry instance is deployed and the artifact is created. You are logged in to the Apicurio Registry web console as the artifact's current owner or as an administrator: http://MY_REGISTRY_URL/ui Procedure On the Artifacts tab, browse the list of artifacts stored in Apicurio Registry, or enter a search string to find the artifact. You can select from the list to search by criteria such as name, group, labels, or global ID. Click the artifact that you want to reassign. In the Version metadata section, click the pencil icon to the Owner field. In the New owner field, select or enter an account name. Click Change owner . Additional resources Installing and deploying Red Hat build of Apicurio Registry on OpenShift 3.6. Configuring Apicurio Registry instance settings using the web console As an administrator, you can use the Apicurio Registry web console to configure dynamic settings for Apicurio Registry instances at runtime. You can manage configuration options for features such as authentication, authorization, and API compatibility. Note Authentication and authorization settings are only displayed in the web console if authentication was already enabled when the Apicurio Registry instance was deployed. For more details, see the Installing and deploying Red Hat build of Apicurio Registry on OpenShift . Prerequisites The Apicurio Registry instance is already deployed. You are logged in to the Apicurio Registry web console with administrator access: http://MY_REGISTRY_URL/ui Procedure In the Apicurio Registry web console, click the Settings tab. Select the settings that you want to configure for this Apicurio Registry instance: Table 3.1. Authentication settings Setting Description HTTP basic authentication Displayed only when authentication is already enabled. When selected, Apicurio Registry users can authenticate using HTTP basic authentication, in addition to OAuth. Not selected by default. Table 3.2. Authorization settings Setting Description Anonymous read access Displayed only when authentication is already selected. When selected, Apicurio Registry grants read-only access to requests from anonymous users without any credentials. This setting is useful if you want to use this instance to publish schemas or APIs externally. Not selected by default. Artifact owner-only authorization Displayed only when authentication is already enabled. When selected, only the user who created an artifact can modify that artifact. Not selected by default. Artifact group owner-only authorization Displayed only when authentication is already enabled and Artifact owner-only authorization is selected. When selected, only the user who created an artifact group has write access to that artifact group, for example, to add or remove artifacts in that group. Not selected by default. Authenticated read access Displayed only when authentication is already enabled. When selected, Apicurio Registry grants at least read-only access to requests from any authenticated user regardless of their user role. Not selected by default. Table 3.3. Compatibility settings Setting Description Legacy ID mode (compatibility API) When selected, the Confluent Schema Registry compatibility API uses globalId instead of contentId as an artifact identifier. This setting is useful when migrating from legacy Apicurio Registry instances based on the v1 Core Registry API. Not selected by default. Table 3.4. Web console settings Setting Description Download link expiry The number of seconds that a generated link to a .zip download file is active before expiring for security reasons, for example, when exporting artifact data from the instance. Defaults to 30 seconds. UI read-only mode When selected, the Apicurio Registry web console is set to read-only, preventing create, read, update, or delete operations. Changes made using the Core Registry API are not affected by this setting. Not selected by default. Table 3.5. Additional properties Setting Description Delete artifact version When selected, users are permitted to delete artifact versions in this instance by using the Core Registry API. Not selected by default. Additional resources Installing and deploying Red Hat build of Apicurio Registry on OpenShift 3.7. Exporting and importing data using the Apicurio Registry web console As an administrator, you can use the Apicurio Registry web console to export data from one Apicurio Registry instance, and import this data into another Apicurio Registry instance. You can use this feature to easily migrate data between different instances. The following example shows how to export and import existing data in a .zip file from one Apicurio Registry instance to another instance. All of the artifact data contained in the Apicurio Registry instance is exported in the .zip file. Note You can import only Apicurio Registry data that has been exported from another Apicurio Registry instance. Prerequisites Apicurio Registry instances have been created as follows: The source instance that you are exporting from contains at least one schema or API artifact The target instance that you are importing into is empty to preserve unique IDs You are logged into the Apicurio Registry web console with administrator access: http://MY_REGISTRY_URL/ui Procedure In the web console for the source Apicurio Registry instance, view the Artifacts tab. Click the options icon (three vertical dots) to Upload artifact , and select Download all artifacts (.zip file) to export the data for this Apicurio Registry instance to a .zip download file. In the the web console for the target Apicurio Registry instance, view the Artifacts tab. Click the options icon to Upload artifact , and select Upload multiple artifacts . Drag and drop or browse to the .zip download file that you exported earlier. Click Upload and wait for the data to be imported.

Commands: