Univention Bugzilla – Bug 53513
[4.4] Traceback when fetching OpenAPI schema from UDM REST API
Last modified: 2022-08-17 17:18:05 CEST
A customer wants to use the Kelvin API and when it is installed, when downloading the OpenAPI schema from 'https://FQDN/univention/udm/openapi.json': ----------------------------------------------------------------------------------------- 23.04.21 06:31:58 ERROR ( 25121) : Uncaught exception GET /udm/openapi.json (0.0.0.0) HTTPServerRequest(protocol='http', host='redacted.intranet', method='GET', uri='/udm/openapi.json', version='HTTP/1.1', remote_ip='0.0.0.0', headers={'X-Umc-Https': 'on', 'Via': '1.1 redacted.intranet', 'Accept-Enco Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 1467, in _execute result = method(*self.path_args, **self.path_kwargs) File "/usr/lib/python2.7/dist-packages/univention/admin/rest/module.py", line 1455, in get model_properties[name] = codec.get_openapi_definition() File "/usr/lib/python2.7/dist-packages/univention/admin/types.py", line 212, in get_openapi_definition return dict((key, value) for key, value in self.openapi_definition().items() if value is not None and value not in (float('inf'), -float('inf'))) File "/usr/lib/python2.7/dist-packages/univention/admin/types.py", line 484, in openapi_definition definition['items'] = self.item_type(self.property, self.property_name).get_openapi_definition() File "/usr/lib/python2.7/dist-packages/univention/admin/types.py", line 212, in get_openapi_definition return dict((key, value) for key, value in self.openapi_definition().items() if value is not None and value not in (float('inf'), -float('inf'))) File "/usr/lib/python2.7/dist-packages/univention/admin/types.py", line 551, in openapi_definition items = [item.get_openapi_definition() for item in self.item_types] TypeError: 'NoneType' object is not iterable ----------------------------------------------------------------------------------------- This will probably be fixed by backporting (from 5.0 to 4.4) a fix done in the scope of Bug #50648 (git:99599bc903933afd75215cf33594171f44190223).
This is fixed in the upcoming release of UCS@school for UCS 5.0.
Sorry that it took so long :( This can be merged. I wasn't sure how to reproduce this, so I ended up writing a test: [5.0-2 3bd28e1457] Bug #53513: Test OpenAPI schema for complex syntax I only added it to 5.0-2 but you can use it for 4.4-9 as well if you want to. Just replace "pytest-3" with "pytest"
Code has been backported: Package: univention-directory-manager-modules Version: 14.0.20-32A~4.4.0.202208151214 univention-directory-manager-modules.yaml d6f4acc07c87 | Bug #53513: fix types definition for complex syntaxes without subsyntax_key_value univention-directory-manager-modules (14.0.20-32) d6f4acc07c87 | Bug #53513: fix types definition for complex syntaxes without subsyntax_key_value
What I tested: Added a new complex syntax to users/user (see 73_udm-rest/03_complex_syntax_type.py)-> No more crash -> OK ComplexMultiValueKeyValueDictType -> OK ComplexMultiValueDictType -> OK ComplexListType (The one that was broken) -> OK jenkins -> OK yaml -> OK
<https://errata.software-univention.de/#/?erratum=4.4x1278>