question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add user-defined artifact metadata?

See original GitHub issue

There may be metadata that users would like to have associated with an artifact stored in Apicurio that does not fit into any of the currently available metadata fields, which are:

  • name (string)
  • description (string)
  • labels (array of strings)
  • createdBy (string)
  • createdOn (long)
  • modifiedBy (string)
  • modifiedOn (long)
  • id (string)
  • version (int)
  • type (ArtifactType)
  • globalId (long)
  • state (ArtifactState)

It would be useful to have a metadata field that can contain more free-form user-definable information. The labels metadata field can hold a list of Strings, although these seem to be more akin to tags to be used for organization/searching and are displayed as such in the UI.

In the Kubernetes world, resources have name-value pairs in the metadata.labels field, which is often used to hold additional information about the resource.

Apicurio could add an extra metadata field for name-value pairs, perhaps named properties (or maybe additionalProperties? Naming is hard 😃 ) which would be defined as a Java Map<String, String> object. This would cover simple name-value pairs, although it wouldn’t allow more complex structures.

In addition to user-defined metadata, the ibmcompat API has fields in it’s metadata objects that don’t easily map to the Apicurio artifact metadata fields (such as the schema name (1) and state.comment fields (2)). Rather than adding those fields directly to the artifact metadata, a properties field could hold the information internally, and the ibmcompat API implementation could populate the additional fields using that data.

I’d be interested to hear what people think about this, and happy to provide a PR if it’s though to be a good idea.

(1) https://github.com/Apicurio/apicurio-registry/blob/b7f2f41225be57ac7ed1e99c6aa94bed4e302332/app/src/main/java/io/apicurio/registry/ibmcompat/model/SchemaSummary.java#L35-L40 (2) https://github.com/Apicurio/apicurio-registry/blob/64a78a7ae61b080ec02c78d17ace6528ca57ce7b/app/src/main/java/io/apicurio/registry/ibmcompat/model/SchemaState.java#L72-L77

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
antonmrycommented, Jul 29, 2020

This is something we were testing and it would help to have this feature. In our tests, only the ‘description’ was editable using the API and we would like to store information about the user who created the artifact. The field createdBy seems a great option but we didn’t find how to populate it using the standard API (we didn’t try with ccompat or ibmcompat).

This part could be also better documented at the API level to understand what fields aren’t editable. There are examples but not a complete list.

https://github.com/Apicurio/apicurio-registry/blob/6cf2db6064581ac15e60770c5d75f1f4226f75a9/common/src/main/resources/META-INF/openapi.json

0reactions
EricWittmanncommented, Aug 25, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

View and Editing Artifact Metadata - Sonatype Help
To add a custom attribute, click on a component, and select the Artifact Metadata tab. Click Add… there and a new row will...
Read more >
Manage artifact metadata in integration accounts - Azure ...
Select the artifact where you want to add metadata, and then select Edit. Screenshot of Azure portal, integration account, and 'Partners' page ...
Read more >
Using Custom Artifact Sources - Harness.io Docs
Step 1: Add an Artifact Source · In your Harness Application, open the Service where you want to use a Custom Artifact Source....
Read more >
User-defined OCI artifact - Harbor docs
These artifacts follow Harbor-specific configuration so that harbor can show their rich metadata in a way and their icons. They are called user-defined...
Read more >
Add metadata to build artifacts - TeamCity Support | JetBrains
We would like to add such metadata to artifacts and then query by it. The metadata may be a label/tag (I know it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found