Skip to content

Commit

Permalink
Disable OAS3.0 build of schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jul 25, 2024
1 parent 68a2c71 commit 4d63644
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions ogc/bblocks/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,26 @@ def update_json_ref(ref: str):
'\n - '.join(potential_yaml_refs.keys()), '\n\n')

# OAS 3.0
try:
if base_url:
oas30_schema_fn = annotated_schema_fn.with_stem('schema-oas3.0')
dump_yaml(oas30.schema_to_oas30(annotated_schema_fn,
urljoin(base_url, str(os.path.relpath(oas30_schema_fn))),
bblocks_register),
oas30_schema_fn)
result.append(oas30_schema_fn)

oas30_schema_json_fn = annotated_schema_json_fn.with_stem('schema-oas3.0')
with open(oas30_schema_json_fn, 'w') as f:
json.dump(oas30.schema_to_oas30(annotated_schema_json_fn,
urljoin(base_url, str(os.path.relpath(oas30_schema_json_fn))),
bblocks_register), f, indent=2)
result.append(oas30_schema_json_fn)
except Exception as e:
print('Error building OAS 3.0 documents:', e, file=sys.stderr)
# try:
# if base_url:
# oas30_schema_fn = annotated_schema_fn.with_stem('schema-oas3.0')
# dump_yaml(oas30.schema_to_oas30(annotated_schema_fn,
# urljoin(base_url, str(os.path.relpath(oas30_schema_fn))),
# bblocks_register),
# oas30_schema_fn)
# result.append(oas30_schema_fn)
#
# print("oas30 yaml dumped", time.time() - start)
#
# oas30_schema_json_fn = annotated_schema_json_fn.with_stem('schema-oas3.0')
# with open(oas30_schema_json_fn, 'w') as f:
# json.dump(oas30.schema_to_oas30(annotated_schema_json_fn,
# urljoin(base_url, str(os.path.relpath(oas30_schema_json_fn))),
# bblocks_register), f, indent=2)
# result.append(oas30_schema_json_fn)
# print("oas30 json dumped", time.time() - start)
# except Exception as e:
# print('Error building OAS 3.0 documents:', e, file=sys.stderr)

return result

Expand Down

0 comments on commit 4d63644

Please sign in to comment.