You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really appreciate taking time to create this repo, I have problem in generating stub for NRF, I just edited the pom.xml file to have only NRF but getting the following error, any help from you will be really appreciated
when I run the server stub, getting the below error
root@Focal:/home/generator/5GC_build/5GC_code_generator/target/generated-sources# python3 -m openapi_server
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/generator/5GC_build/5GC_code_generator/target/generated-sources/openapi_server/main.py", line 19, in
main()
File "/home/generator/5GC_build/5GC_code_generator/target/generated-sources/openapi_server/main.py", line 11, in main
app.add_api('openapi.yaml',
File "/usr/local/lib/python3.8/dist-packages/connexion/apps/flask_app.py", line 72, in add_api
api = super().add_api(specification, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/connexion/apps/abstract.py", line 149, in add_api
api = self.api_cls(specification,
File "/usr/local/lib/python3.8/dist-packages/connexion/apis/abstract.py", line 81, in init
self.specification = Specification.load(specification, arguments=arguments)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 194, in load
return cls.from_file(spec, arguments=arguments)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 148, in from_file
return cls.from_dict(spec)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 186, in from_dict
return OpenAPISpecification(spec)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 74, in init
self._validate_spec(raw_spec)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 92, in _validate_spec
raise InvalidSpecification.create_from(e)
connexion.exceptions.InvalidSpecification: {'content': {'application/json': {'schema': {'items': {'$ref': '#/components/schemas/PlmnId'}, 'minItems': 1, 'type': 'array'}}}, 'description': 'Id of the PLMN of the target NF', 'explode': True, 'in': 'query', 'name': 'target-plmn-list', 'required': False, 'style': 'form'} is not valid under any of the given schemas
Failed validating 'oneOf' in schema['properties']['paths']['patternProperties']['^\/']['patternProperties']['^(get|put|post|delete|options|head|patch|trace)$']['properties']['parameters']['items']:
{'oneOf': [{'$ref': '#/definitions/Parameter'},
{'$ref': '#/definitions/Reference'}]}
On instance['paths']['/nf-instances']['get']['parameters'][6]:
{'content': {'application/json': {'schema': {'items': {'$ref': '#/components/schemas/PlmnId'},
'minItems': 1,
'type': 'array'}}},
'description': 'Id of the PLMN of the target NF',
'explode': True,
'in': 'query',
'name': 'target-plmn-list',
'required': False,
'style': 'form'}
The same works for the N32 handshake that is present in your default pom without any changes but anything other than that is failing
The text was updated successfully, but these errors were encountered:
Thank you for reporting this. Unfortunately not all OpenAPI generators are according to the latest OpenAPI specification. You can see this in issue #11. Maybe you can try to use different generator like jersey2 library, however very likely you will run into similar problems, once you will try to compile complex 5G yaml file.
I would recommend to read this issue jdegre/5GC_APIs#17. And if you do need to implement the whole Network Function you can see these slides with HTTP/2 client python code on it. I hope this could help.
@H21lab thanks for replying, really appreciate it, I ran into same problem with new Yaml and generators as well, jdegre/5GC_APIs#51 , have you seen anyone able to create the stub with generators? Is python the problem here?
Really appreciate taking time to create this repo, I have problem in generating stub for NRF, I just edited the pom.xml file to have only NRF but getting the following error, any help from you will be really appreciated
pom.xml file
python-flask ${project.build.directory}/generated-sourceswhen I run the server stub, getting the below error
root@Focal:/home/generator/5GC_build/5GC_code_generator/target/generated-sources# python3 -m openapi_server
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/generator/5GC_build/5GC_code_generator/target/generated-sources/openapi_server/main.py", line 19, in
main()
File "/home/generator/5GC_build/5GC_code_generator/target/generated-sources/openapi_server/main.py", line 11, in main
app.add_api('openapi.yaml',
File "/usr/local/lib/python3.8/dist-packages/connexion/apps/flask_app.py", line 72, in add_api
api = super().add_api(specification, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/connexion/apps/abstract.py", line 149, in add_api
api = self.api_cls(specification,
File "/usr/local/lib/python3.8/dist-packages/connexion/apis/abstract.py", line 81, in init
self.specification = Specification.load(specification, arguments=arguments)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 194, in load
return cls.from_file(spec, arguments=arguments)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 148, in from_file
return cls.from_dict(spec)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 186, in from_dict
return OpenAPISpecification(spec)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 74, in init
self._validate_spec(raw_spec)
File "/usr/local/lib/python3.8/dist-packages/connexion/spec.py", line 92, in _validate_spec
raise InvalidSpecification.create_from(e)
connexion.exceptions.InvalidSpecification: {'content': {'application/json': {'schema': {'items': {'$ref': '#/components/schemas/PlmnId'}, 'minItems': 1, 'type': 'array'}}}, 'description': 'Id of the PLMN of the target NF', 'explode': True, 'in': 'query', 'name': 'target-plmn-list', 'required': False, 'style': 'form'} is not valid under any of the given schemas
Failed validating 'oneOf' in schema['properties']['paths']['patternProperties']['^\/']['patternProperties']['^(get|put|post|delete|options|head|patch|trace)$']['properties']['parameters']['items']:
{'oneOf': [{'$ref': '#/definitions/Parameter'},
{'$ref': '#/definitions/Reference'}]}
On instance['paths']['/nf-instances']['get']['parameters'][6]:
{'content': {'application/json': {'schema': {'items': {'$ref': '#/components/schemas/PlmnId'},
'minItems': 1,
'type': 'array'}}},
'description': 'Id of the PLMN of the target NF',
'explode': True,
'in': 'query',
'name': 'target-plmn-list',
'required': False,
'style': 'form'}
The same works for the N32 handshake that is present in your default pom without any changes but anything other than that is failing
The text was updated successfully, but these errors were encountered: