Fix some checkmate bad schemas

This commit is contained in:
Ayaz Hafiz 2023-07-16 15:16:57 -05:00
parent fcd733e1df
commit b3ccc905a4
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
7 changed files with 125 additions and 157 deletions

View file

@ -146,7 +146,7 @@ pub enum RecordFieldKind {
}
#[derive(Serialize, JsonSchema, Debug)]
#[serde(tag = "type")]
#[serde(tag = "type", content = "variable")]
pub enum TagUnionExtension {
Openness(Variable),
Any(Variable),
@ -192,7 +192,6 @@ pub enum UnificationMode {
#[derive(Serialize, JsonSchema, Debug)]
#[serde(tag = "type")]
pub enum Event {
VariableEvent(VariableEvent),
Unification {
left: Variable,
right: Variable,
@ -200,30 +199,19 @@ pub enum Event {
success: Option<bool>,
subevents: Vec<Event>,
},
}
#[derive(Serialize, JsonSchema, Debug)]
pub struct AllEvents(pub Vec<Event>);
#[derive(Serialize, JsonSchema, Debug)]
#[serde(tag = "type")]
pub enum VariableEvent {
Unify {
VariableUnified {
from: Variable,
to: Variable,
},
SetDescriptor {
VariableSetDescriptor {
variable: Variable,
rank: Option<Rank>,
content: Option<Content>,
},
}
impl From<VariableEvent> for Event {
fn from(event: VariableEvent) -> Event {
Event::VariableEvent(event)
}
}
#[derive(Serialize, JsonSchema, Debug)]
pub struct AllEvents(pub Vec<Event>);
impl AllEvents {
pub fn schema() -> RootSchema {