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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

laysakura
Copy link

Implements Problem Details as a struct, with JSON serialize.

Usecases:

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

}

impl ProblemDetails {
pub fn new<T: ProblemType>(problem_type: T, title: String, detail: String) -> Self {
Copy link
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.

@@ -5,9 +5,11 @@ use iref::Iri;

use crate::syntax::RequiredContext;

mod algorithm;
Copy link
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