Skip to content

Commit

Permalink
feat: Add keep_defs to replace_refs
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Dec 15, 2024
1 parent 9868d34 commit a8dcd53
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

0.6.5 (2024-12-14)
------------------

- :meth:`ocdsextensionregistry.util.replace_refs`: Add the ``keep_defs`` keyword argument.

0.6.4 (2024-12-14)
------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = "Open Contracting Partnership"

# The short X.Y version
version = "0.6.4"
version = "0.6.5"
# The full version, including alpha/beta/rc tags
release = version

Expand Down
5 changes: 3 additions & 2 deletions ocdsextensionregistry/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ def loader(url, **kwargs):
raise NotImplementedError


def replace_refs(schema, **kwargs):
def replace_refs(schema, *, keep_defs=False, **kwargs):
deref = jsonref.replace_refs(schema, proxies=False, merge_props=True, loader=loader, **kwargs)
deref.pop('definitions', None)
if not keep_defs:
deref.pop('definitions', None)
return deref


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ocdsextensionregistry"
version = "0.6.4"
version = "0.6.5"
authors = [{name = "Open Contracting Partnership", email = "[email protected]"}]
description = "Eases access to information from the extension registry of the Open Contracting Data Standard"
readme = "README.rst"
Expand Down

0 comments on commit a8dcd53

Please sign in to comment.