Repository navigation
[16.0][FIX] shopfloor_reception_add_packaging: fix schema for create_new_packaging - #1288
Merged
OCA-git-bot merged 1 commit intoSep 29, 2026
Conversation
…ckaging
The OpenAPI schema generator in base_rest (`cerberus_to_json`) fails with
`AttributeError: 'str' object has no attribute 'get'` when generating
Swagger documentation for Reception.
This occurs because `packaging_levels` was incorrectly defined as a `dict`
wrapping a `list` schema produced by `self.schemas._schema_list_of(...)`.
`_schema_list_of` already returns a properly formatted Cerberus dictionary
specifying `"type": "list"`. Wrapping it under an extra `{"type": "dict", "schema": ...}`
caused `cerberus_to_json` to misinterpret `"type": "list"` as a dictionary field
specification and attempt to call `.get()` on the string `'list'`.
lmignon
approved these changes
Sep 29, 2026
Contributor
|
This PR looks fantastic, let's merge it! |
Contributor
|
Congratulations, your PR was merged at ab5789c. Thanks a lot for contributing to OCA. ❤️ |
lmignon
deleted the
16.0-fix-shopfloor_reception_add_packaging-invalid-schema
branch
September 30, 2026 08:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The OpenAPI schema generator in base_rest (
cerberus_to_json) fails withAttributeError: 'str' object has no attribute 'get'when generatingSwagger documentation for Reception.
This occurs because
packaging_levelswas incorrectly defined as adictwrapping a
listschema produced byself.schemas._schema_list_of(...)._schema_list_ofalready returns a properly formatted Cerberus dictionaryspecifying
"type": "list". Wrapping it under an extra{"type": "dict", "schema": ...}caused
cerberus_to_jsonto misinterpret"type": "list"as a dictionary fieldspecification and attempt to call
.get()on the string'list'.cc @jbaudoux