Find schemas by IDs
Hi,
I'm trying to filter schemas by ID in the schema registry view, but I'm not having any luck. Does this feature exist?
My apologies if this issue has been brought up before, I wasn't able to locate any previous discussion on the topic.
Thanks!
Hey @OuesFa , thanks for filing the issue. I don't have a schema registry view present right now, but I assume on the overview that lists all schemas we should add a column with the schema id to address your problem right?
The solution would be an input box designed to enter the ID of a specific schema. The tool could then fetch and display this schema based on the provided ID.
EDIT: Thank you for your answer obviously :)
@vladoschreiner @ivpanda ^^ for mockup
@twmb This is included in the mockups right now. We planned to reuse the existing box but allow users to enter ID as well.
Currently waiting for a new backend api that resolves a given schema ID to the subject (name) it belongs to. @bojand @weeco
I believe there should be existing backend APIs to satisfy requirements for this.
Given a schema ID we can get the subjects like so:
❯ xh http://127.0.0.1:9090/api/schema-registry/schemas/ids/13/versions
HTTP/1.1 200 OK
...
Vary: Accept-Encoding
[
{
"subject": "schema_four",
"version": 2
},
{
"subject": "object_5",
"version": 1
}
]
Given a subject and a schema version, we can get the details of a schema:
❯ xh http://127.0.0.1:9090/api/schema-registry/subjects/widgets.v1-value/versions/1
HTTP/1.1 200 OK
...
Vary: Accept-Encoding
{
"name": "widgets.v1-value",
"type": "PROTOBUF",
"compatibility": "DEFAULT",
"versions": [
{
"version": 1,
"isSoftDeleted": false
}
],
"latestActiveVersion": 1,
"schemas": [
{
"id": 35,
"version": 1,
"isSoftDeleted": false,
"type": "PROTOBUF",
"schema": "syntax = \"proto3\";...;\n}\n",
"references": [
{
"name": "proto/common/envelope.proto",
"subject": "proto/common/envelope.proto",
"version": 1
}
]
}
]
}
Given a schema we can get what subjects it is referenced by:
❯ xh http://127.0.0.1:9090/api/schema-registry/subjects/proto%2Fcommon%2Fenvelope.proto/versions/1/referencedby
HTTP/1.1 200 OK
...
Vary: Accept-Encoding
[
{
"schemaId": 37,
"usages": [
{
"subject": "options/order_book.proto",
"version": 1
},
{
"subject": "spotcoin.v1-value",
"version": 1
}
]
},
{
"schemaId": 41,
"usages": [
{
"subject": "futures-minutely-value",
"version": 1
}
]
},
{
"schemaId": 38,
"usages": [
{
"subject": "futures/order_book.proto",
"version": 1
}
]
},
{
"schemaId": 35,
"usages": [
{
"subject": "widgets.v1-value",
"version": 1
}
]
}
]
Will be fixed via https://github.com/redpanda-data/console/pull/1144
done in https://github.com/redpanda-data/console/pull/1144