Skip to content

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

Closed
@webmaster128

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    stdcosmwasm-std crate

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions