Skip to content

feat: fill in the metadata of resource schema#12224

Merged
moonming merged 8 commits into
apache:masterfrom
bzp2010:bzp/feat-reorg-resource-metadata
May 29, 2025
Merged

feat: fill in the metadata of resource schema#12224
moonming merged 8 commits into
apache:masterfrom
bzp2010:bzp/feat-reorg-resource-metadata

Conversation

@bzp2010

@bzp2010 bzp2010 commented May 17, 2025

Copy link
Copy Markdown
Contributor

Description

This PR organizes the resource schema and ensures that resources that are primarily manipulated by users contain a metadata section consisting of name, desc, labels.

This will address some issues in downstream projects such as the new embedded dashboard or the API declarative configuration tool for APISIX (ADC).

Resource Status
Route name✅
desc✅
labels✅
Service name✅
desc✅
labels✅
Upstream name✅
desc✅
labels✅
Consumer name❌ Replaces name and id with username, which will always have the same value.
desc➕
labels✅
ConsumerCredential name➕
desc✅
labels✅
SSL name❌ SSL does not appear to require a name, and SNI combinations can often represent SSL resources.
desc➕
labels✅
Proto name➕
desc✅
labels➕
Strictly, this is plugin data and should not be part of the APISIX core resources. When we design a new API to allow plugins to register their own resources, it will be removed and the core resource schema.
GlobalRule N/A
It is simply a combination of one or more plugins so that they run globally and therefore do not require metadata fields.
StreamRoute name➕
desc✅
labels✅
PluginConfig name✅It uses a different name schema than other resources, with no explicit maximum length limit, which is presumably intended for ingress controllers.
desc✅
labels✅
ConsumerGroup name➕
desc✅
labels✅
PluginMetadata N/A
It corresponds one-to-one with each plugin and does not require metadata fields.
Secret N/A
It uniquely configures a secret provider using the secret provider and id and requires no additional metadata fields.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)
    • 🔥🔥🔥I added additionalProperties to consumer credential. It is now consistent with the other core resources. I think this is a fix for a historical bug. 🔥🔥🔥
    • If other maintainers think it's a critical break change, I'll remove it, it's not very important for the current PR.

@bzp2010 bzp2010 changed the title feat: fill in the metadata of resource feat: fill in the metadata of resource schema May 17, 2025
@bzp2010
bzp2010 force-pushed the bzp/feat-reorg-resource-metadata branch from 57243ae to 386ec6c Compare May 20, 2025 01:57
@bzp2010
bzp2010 marked this pull request as ready for review May 20, 2025 11:56
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 20, 2025
juzhiyuan
juzhiyuan previously approved these changes May 20, 2025
Comment thread t/ts/admin_api.ts
nic-6443
nic-6443 previously approved these changes May 21, 2025
Comment thread docs/en/latest/admin-api.md Outdated
SkyeYoung
SkyeYoung previously approved these changes May 21, 2025

@SkyeYoung SkyeYoung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see this change. This makes APISIX's APIs more user-friendly for the dashboard project.

@bzp2010
bzp2010 requested a review from Baoyuantop May 21, 2025 05:37
Baoyuantop
Baoyuantop previously approved these changes May 21, 2025
kayx23
kayx23 previously approved these changes May 21, 2025
Comment thread docs/en/latest/admin-api.md Outdated
Comment thread docs/zh/latest/admin-api.md Outdated
Comment thread docs/zh/latest/admin-api.md Outdated
Comment thread docs/zh/latest/admin-api.md Outdated
@bzp2010
bzp2010 dismissed stale reviews from kayx23, Baoyuantop, and SkyeYoung via 47ba2ac May 21, 2025 06:41
@bzp2010
bzp2010 dismissed stale reviews from nic-6443 and juzhiyuan via 47ba2ac May 21, 2025 06:41

@membphis membphis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@moonming
moonming merged commit 3cb191a into apache:master May 29, 2025
laz-xyr pushed a commit to laz-xyr/apisix that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants