Open bhati-pradeep opened 1 year ago
I was able to overcome this issue by moving line https://github.com/ansible-community/ansible.content_builder/blob/15a074270083fe091fb79a9f14f2d7b0272fdcd1/roles/module_openapi_security/templates/doc_generator.py#L875
Above one line, so it looks like this
post_properties = OrderedDict()
if request_fields:
post_properties.update(
I'm having the same issue as OP.
@kksat fix let me continue but I then ran into an issue with module_openapi_security__' is undefined
. Not sure if related or not.
SUMMARY
I am trying to generate schema from Open API json (Nutanix subnet API) and it gives me
UnboundLocalError: local variable 'post_properties' referenced before assignment
error.Error is coming from : https://github.com/ansible-community/ansible.content_builder/blob/1a8071e914aa1f25a84670b320c2295736a00818/roles/module_openapi_security/templates/doc_generator.py#L904
ISSUE TYPE
COMPONENT NAME
module_openapi
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Mac OS Monterey
STEPS TO REPRODUCE
Create build.yaml and manifest.yaml as per below files. Download open api yaml from https://developers.nutanix.com/api/v1/namespaces/networking/versions/v4.0.b1/yaml and convert it using https://editor-next.swagger.io/ to json format.
build.yaml
manifest.yaml
Error:
EXPECTED RESULTS
Code generation should go fine.
ACTUAL RESULTS
Failing with error as above.