Skip to content

feat: add ProblemDetails module for Verifiable Credentials Data Model v2.0 - #585

Open
laysakura wants to merge 1 commit into
spruceid:mainfrom
laysakura:feat/ProblemDetails
Open

feat: add ProblemDetails module for Verifiable Credentials Data Model v2.0#585
laysakura wants to merge 1 commit into
spruceid:mainfrom
laysakura:feat/ProblemDetails

Conversation

@laysakura

Copy link
Copy Markdown

Implements Problem Details as a struct, with JSON serialize.

Usecases:

  • didkit-http may want to use this as error response bodies.

@laysakura
laysakura force-pushed the feat/ProblemDetails branch from 46f4713 to 524ca52 Compare July 23, 2024 07:42
@laysakura
laysakura force-pushed the feat/ProblemDetails branch from 524ca52 to 9d4e4d6 Compare July 23, 2024 07:44
}

impl ProblemDetails {
pub fn new<T: ProblemType>(problem_type: T, title: String, detail: String) -> Self {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use problem_type: impl ProblemType directly instead of declaring a new type parameter.


use crate::syntax::RequiredContext;

mod algorithm;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the algorithm module will contain anything else so I would put it in its own problem module.

pub mod problem;
pub use problem::ProblemDetails;

@timothee-haudebourg timothee-haudebourg self-assigned this Aug 23, 2024
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

Successfully merging this pull request may close these issues.

2 participants