Skip to content

Commit e1cccc9

Browse files
committed
feat: Support for deprecated keyword
1 parent be05b86 commit e1cccc9

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

.github/workflows/semantic-release.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
egress-policy: audit
1818

1919
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20-
with:
21-
token: ${{ secrets.COMMIT_TOKEN }}
2220
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
2321
with:
2422
node-version: 'lts/*'

json_schema_for_humans/schema/schema_keyword.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ class SchemaKeyword(Enum):
3636
ADDITIONAL_PROPERTIES = "additionalProperties"
3737
FORMAT = "format"
3838
TYPE = "type"
39+
DEPRECATED = "deprecated"

json_schema_for_humans/schema/schema_node.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ def kw_pattern(self) -> Optional["SchemaNode"]:
374374
def kw_properties(self) -> Optional["SchemaNode"]:
375375
return self.get_keyword(SchemaKeyword.PROPERTIES)
376376

377+
@property
378+
def kw_deprecated(self) -> Optional["SchemaNode"]:
379+
return self.get_keyword(SchemaKeyword.DEPRECATED)
380+
377381
@property
378382
def kw_pattern_properties(self) -> Optional["SchemaNode"]:
379383
return self.get_keyword(SchemaKeyword.PATTERN_PROPERTIES)

json_schema_for_humans/templates/js/section_properties.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2 class="mb-0">
1616
{%- if sub_property.is_required_property -%}
1717
{{ " " }}<span class="badge badge-warning required-property">Required</span>
1818
{%- endif -%}
19-
{%- if sub_property is deprecated -%}
19+
{%- if sub_property is deprecated or sub_property.kw_deprecated -%}
2020
{{ " " }}<span class="badge badge-danger deprecated-property">Deprecated</span>
2121
{%- endif -%}
2222
{%- if sub_property.is_pattern_property -%}

json_schema_for_humans/templates/js_offline/section_properties.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2 class="mb-0">
1616
{%- if sub_property.is_required_property -%}
1717
{{ " " }}<span class="badge badge-warning required-property">Required</span>
1818
{%- endif -%}
19-
{%- if sub_property is deprecated -%}
19+
{%- if sub_property is deprecated or sub_property.kw_deprecated -%}
2020
{{ " " }}<span class="badge badge-danger deprecated-property">Deprecated</span>
2121
{%- endif -%}
2222
{%- if sub_property.is_pattern_property -%}

0 commit comments

Comments
 (0)