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

Type "Never" cannot be expressed as JSON schema #451

Closed
webmaster128 opened this issue Jun 25, 2020 · 1 comment · Fixed by #452
Closed

Type "Never" cannot be expressed as JSON schema #451

webmaster128 opened this issue Jun 25, 2020 · 1 comment · Fixed by #452
Labels
std cosmwasm-std crate
Milestone

Comments

@webmaster128
Copy link
Member

We use

/// Never can never be instantiated and is a no-op placeholder for
/// unsupported enums, such as contracts that don't set a custom message.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub enum Never {}

in public interfaces. However, enums with no case are not valid JSON Schema:

The enum keyword is used to restrict a value to a fixed set of values. It must be an array with at least one element, where each element is unique.

Interfaces with such a type cannot be processed to TS types and their Schema files are invalid.

@webmaster128 webmaster128 added the std cosmwasm-std crate label Jun 25, 2020
@webmaster128 webmaster128 modified the milestones: 1.0.0, 0.9.1 Jun 25, 2020
@webmaster128
Copy link
Member Author

Version 0.9.0 was yanked on crates.io. With this API flaw, it is of no use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
std cosmwasm-std crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant