-
Notifications
You must be signed in to change notification settings - Fork 44
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
error response #17
error response #17
Conversation
@@ -55,3 +56,9 @@ class OptimadeStructureResponse1(OptimadeResponse1): | |||
|
|||
class OptimadeStructureResponseMany(OptimadeResponseMany): | |||
data: List[StructureResource] | |||
|
|||
|
|||
class OptimadeErrorResponse(BaseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec says:
If there were errors in producing the response all other fields MAY be skipped, and the following field MUST be present: errors
So, I guess, meta
would also be optional.
And there's also included
that's missing from above, right?
Do we actually need a subclass for this?
Can't we simply add errors
as an optional field in OptimadeResponse1
and OptimadeResponseMany
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, meta would be optional as well. I'm not sure we need a subclass either. I would like to merge just so we get optimade/server/models/errors.py
in and then follow-up PRs can refactor / correct misreadings of the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth merging this in now for the error models and we can refactor their inclusion in follow-up PRs.
@@ -55,3 +56,9 @@ class OptimadeStructureResponse1(OptimadeResponse1): | |||
|
|||
class OptimadeStructureResponseMany(OptimadeResponseMany): | |||
data: List[StructureResource] | |||
|
|||
|
|||
class OptimadeErrorResponse(BaseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, meta would be optional as well. I'm not sure we need a subclass either. I would like to merge just so we get optimade/server/models/errors.py
in and then follow-up PRs can refactor / correct misreadings of the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed conflicts. Again, I think this is worth merging and then correcting with followup PRs.
Adding error response