feat(models): add SnapInfo model for snapd response#908
feat(models): add SnapInfo model for snapd response#908PraaneshSelvaraj wants to merge 1 commit intocanonical:mainfrom
Conversation
|
Hi @bepri, raising this as a draft PR to confirm the model structure before proceeding with replacing the current dict-based access in The model currently includes only the fields consumed in |
bepri
left a comment
There was a problem hiding this comment.
The implementation looks good so far, though I'm a bit on the fence about extra="allow" on the models. I think I'd like others' opinions on this though, because I could go either way. Thoughts, @lengau?
I think you should be good to proceed with the remaining work, regardless of the answer. Be sure to add some unit tests for this. I'd get a few real API responses from snapd, store them in variables in a test file, and then validate them. Then make sure it rejects an entirely malformed response and a response indicating an error from snapd.
|
Hey, quick question about the test mocks. In the implementation, the {
"id": "",
"name": "test-name",
"type": "app",
"base": "coreXX",
"version": "0.1",
"channel": "",
"revision": "2",
"publisher": {"id": ""},
"confinement": "classic",
}Since the model is defined with or we can explicitly model more of the snapd response instead of relying on extra="allow"? |
WIP
Objective: introduce a Pydantic model for the snapd snap info response.
make lint && make test?