pub enum JsonDeserializationError {
Show 21 variants
Serde(Error),
ExprParseError(ParseError),
EntityParseError(ParseError),
ExtnParseError(ParseError),
RestrictedExpressionError(RestrictedExpressionError),
ExtensionsError(ExtensionsError),
ExpectedLiteralEntityRef {
ctx: Box<JsonDeserializationErrorContext>,
got: Box<Expr>,
},
ExpectedExtnValue {
ctx: Box<JsonDeserializationErrorContext>,
got: Box<Expr>,
},
ExpectedContextToBeRecord {
got: Box<RestrictedExpr>,
},
ActionParentIsNonAction {
uid: EntityUID,
parent: EntityUID,
},
ImpliedConstructorNotFound {
ctx: Box<JsonDeserializationErrorContext>,
return_type: Box<SchemaType>,
arg_type: Box<SchemaType>,
},
UnexpectedEntityType {
uid: EntityUID,
suggested_types: Vec<EntityType>,
},
UndeclaredAction {
uid: EntityUID,
},
ActionDeclarationMismatch {
uid: EntityUID,
},
UnexpectedEntityAttr {
uid: EntityUID,
attr: SmolStr,
},
UnexpectedRecordAttr {
ctx: Box<JsonDeserializationErrorContext>,
record_attr: SmolStr,
},
MissingRequiredEntityAttr {
uid: EntityUID,
attr: SmolStr,
},
MissingRequiredRecordAttr {
ctx: Box<JsonDeserializationErrorContext>,
record_attr: SmolStr,
},
TypeMismatch {
ctx: Box<JsonDeserializationErrorContext>,
expected: Box<SchemaType>,
actual: Box<SchemaType>,
},
HeterogeneousSet {
ctx: Box<JsonDeserializationErrorContext>,
ty1: Box<SchemaType>,
ty2: Box<SchemaType>,
},
InvalidParentType {
ctx: Box<JsonDeserializationErrorContext>,
uid: EntityUID,
parent_ty: Box<EntityType>,
},
}
Expand description
Errors thrown during deserialization from JSON
Variants§
Serde(Error)
Error thrown by serde_json
ExprParseError(ParseError)
Contents of an __expr
escape failed to parse as a Cedar expression.
__expr
is deprecated (starting with the 1.2 release), and once it is
removed, this error will also be removed.
EntityParseError(ParseError)
Contents of an __entity
escape failed to parse as an entity reference
ExtnParseError(ParseError)
Function name in an __extn
escape failed to parse as an extension function name
RestrictedExpressionError(RestrictedExpressionError)
Restricted expression error
ExtensionsError(ExtensionsError)
Error thrown by an operation on Extensions
ExpectedLiteralEntityRef
Fields
ctx: Box<JsonDeserializationErrorContext>
Context of this error
A field that needs to be a literal entity reference, was some other JSON value
ExpectedExtnValue
Fields
ctx: Box<JsonDeserializationErrorContext>
Context of this error
A field that needs to be an extension value, was some other JSON value
ExpectedContextToBeRecord
Fields
got: Box<RestrictedExpr>
Expression we got instead
Contexts need to be records, but we got some other JSON value
ActionParentIsNonAction
Fields
Parents of actions should be actions, but this action has a non-action parent
ImpliedConstructorNotFound
Fields
ctx: Box<JsonDeserializationErrorContext>
Context of this error
return_type: Box<SchemaType>
return type of the constructor we were looking for
arg_type: Box<SchemaType>
argument type of the constructor we were looking for
Schema-based parsing needed an implicit extension constructor, but no suitable constructor was found
UnexpectedEntityType
Fields
suggested_types: Vec<EntityType>
Suggested similar entity types that actually are declared in the schema (if any)
During schema-based parsing, encountered an entity of a type which is not declared in the schema. (This error is only used for non-Action entity types.)
UndeclaredAction
During schema-based parsing, encountered an action which was not declared in the schema
ActionDeclarationMismatch
During schema-based parsing, encountered an action whose definition doesn’t precisely match the schema’s declaration of that action
UnexpectedEntityAttr
Fields
During schema-based parsing, encountered this attribute on this entity, but that attribute shouldn’t exist on entities of this type
UnexpectedRecordAttr
Fields
ctx: Box<JsonDeserializationErrorContext>
Context of this error
During schema-based parsing, encountered this attribute on a record, but that attribute shouldn’t exist on that record
MissingRequiredEntityAttr
Fields
During schema-based parsing, didn’t encounter this attribute of a record, but that attribute should have existed
MissingRequiredRecordAttr
Fields
ctx: Box<JsonDeserializationErrorContext>
Context of this error
During schema-based parsing, didn’t encounter this attribute of a record, but that attribute should have existed
TypeMismatch
Fields
ctx: Box<JsonDeserializationErrorContext>
Context of this error
expected: Box<SchemaType>
Type which was expected
actual: Box<SchemaType>
Type which was encountered instead
During schema-based parsing, the given attribute on the given entity had a different type than the schema indicated to expect
HeterogeneousSet
Fields
ctx: Box<JsonDeserializationErrorContext>
Context of this error
ty1: Box<SchemaType>
First element type which was found
ty2: Box<SchemaType>
Second element type which was found
During schema-based parsing, found a set whose elements don’t all have the same type. This doesn’t match any possible schema.
InvalidParentType
Fields
ctx: Box<JsonDeserializationErrorContext>
Context of this error
parent_ty: Box<EntityType>
Parent type which was invalid
During schema-based parsing, found a parent of a type that’s not allowed for that entity