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

Bug: Schema.dict() 显示异常 #50

Closed
idranme opened this issue Jun 25, 2023 · 2 comments
Closed

Bug: Schema.dict() 显示异常 #50

idranme opened this issue Jun 25, 2023 · 2 comments

Comments

@idranme
Copy link

idranme commented Jun 25, 2023

image

问题:点击“添加项目”后,最底下会额外多出一个选择框。

复现:

export interface Config { }

export const Config: Schema<Config> = Schema.object({
  constants: Schema.dict(Schema.intersect([
    Schema.object({
      type: Schema.union(['foo', 'bar']).required(),
    }).description('基础配置'),
    Schema.union([
      Schema.object({
        type: Schema.const('foo').required(),
        value: Schema.number().default(114514),
        aaa: Schema.union(['bbb', 'ccc']).required()
      }).description('特殊配置 1'),
      Schema.object({
        type: Schema.const('bar').required(),
        text: Schema.string(),
        aaa: Schema.union(['bbb', 'ccc']).required()
      }).description('特殊配置 2'),
    ]),
  ])).description('常量列表')
}).description('常量设置')
@shigma
Copy link
Owner

shigma commented Jun 25, 2023

修一个 bug 又来一个 🤣

@idranme
Copy link
Author

idranme commented Jun 25, 2023

修一个 bug 又来一个 🤣

哈哈哈哈~

@shigma shigma closed this as completed in 761e107 Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants