Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use allOf schemas with additionalProperties, when change allof ,I don't want the data value of the previous anyof #4189

Open
1 task done
xiaomuzizier opened this issue May 9, 2024 · 1 comment

Comments

@xiaomuzizier
Copy link

xiaomuzizier commented May 9, 2024

Prerequisites

What theme are you using?

antd

What is your question?

image when change anyof ,use options 2, image the value still live.

{ "type": "object", "anyOf": [ { "title": "buildUniversalScheme(构建通用的scheme协议)", "properties": { "schemeFunction": { "title": "协议方法", "type": "string", "default": "buildUniversalScheme", "hidden": true }, "schemeType": { "title": "协议类型", "type": "string", } }, "additionalProperties": { "type": "string" }, "required": ["schemeType"] }, { "title":"文章底层页", "properties": { "schemeFunction": { "title": "协议方法", "type": "string", "default": "buildArticleScheme", "hidden": true }, "id": { "title": "文章id", "type": "string" }, "chlid": { "title": "频道id", "type": "string" } }, "additionalProperties": { "type": "string" }, "required": ["id"] }, { "title":"评论底层页", "properties": { "schemeFunction": { "title": "协议方法", "type": "string", "default": "buildCommentScheme", "hidden": true }, "id": { "title": "文章id", "type": "string" }, "chlid": { "title": "频道id", "type": "string" } }, "additionalProperties": { "type": "string" }, "required": ["id"] }, { "title":"评论底层页并唤起发表评论框", "properties": { "schemeFunction": { "title": "协议方法", "type": "string", "default": "buildCommentAndPublishScheme" }, "id": { "title": "文章id", "type": "string" }, "chlid": { "title": "频道id", "type": "string" } }, "additionalProperties": { "type": "string" }, "required": ["id"] } ] }

in my program, I maybe use "additionalProperties ,if two choice has additionalProperties. I change one,add some field,the else choice has this additionalProperties
it means "additionalProperties still live. i dont want this ,what should I do? thx

@xiaomuzizier xiaomuzizier added needs triage Initial label given, to be assigned correct labels and assigned question labels May 9, 2024
@heath-freenome
Copy link
Member

@xiaomuzizier Can you please provide a link to the playground you are showing me in the screenshots?

@heath-freenome heath-freenome added awaiting response and removed needs triage Initial label given, to be assigned correct labels and assigned labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants