forked from openapi-generators/openapi-python-client
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels_init.py.jinja
More file actions
33 lines (27 loc) · 885 Bytes
/
models_init.py.jinja
File metadata and controls
33 lines (27 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Testing that we can access model-related information via Jinja variables.
# To avoid having to update this file in the golden record every time the test specs are changed,
# we won't include all the classes in this output - we'll just look for one of them.
# Using "alls"
{% for name in alls %}
{% if name == "AModel" %}
# {{ name }}
{% endif %}
{% endfor %}
# Using "imports"
{% for import in imports %}
{% if import.endswith("import AModel") %}
# {{ import }}
{% endif %}
{% endfor %}
# Using "openapi.models"
{% for model in openapi.models %}
{% if model.class_info.name == "AModel" %}
# {{ model.class_info.name }} ({{ model.class_info.module_name }})
{% endif %}
{% endfor %}
# Using "openapi.enums"
{% for enum in openapi.enums %}
{% if enum.class_info.name == "AnEnum" %}
# {{ enum.class_info.name }} ({{ enum.class_info.module_name }})
{% endif %}
{% endfor %}