Skip to content

Commit

Permalink
Merge pull request CMSgov#33 from CMSgov/conditional-refactor
Browse files Browse the repository at this point in the history
minor refactor to remove the 'not' conditional language
  • Loading branch information
shaselton-usds authored Apr 22, 2024
2 parents 6f49e55 + 23d1183 commit eca314c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hpt-validator",
"version": "1.3.0",
"version": "1.3.1",
"author": "CMS Open Source <[email protected]>",
"license": "CC0-1.0",
"description": "Validation library for CMS Hospital Price Transparency machine-readable files",
Expand Down
9 changes: 4 additions & 5 deletions src/versions/2.0/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,15 @@ const STANDARD_CHARGE_DEFINITIONS = {
properties: {
payers_information: {
type: "array",
items: {
contains: {
type: "object",
not: {
required: ["standard_charge_dollar"],
},
required: ["standard_charge_dollar"],
},
},
},
required: ["payers_information"],
},
else: {
then: {
required: ["minimum", "maximum"],
},
},
Expand Down
6 changes: 3 additions & 3 deletions test/2.0/json.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ test("validateJsonConditionals", async (t) => {
{
path: "/standard_charge_information/1/standard_charges/0",
field: "0",
message: 'must match "else" schema',
message: 'must match "then" schema',
},
{
path: "/standard_charge_information/2/standard_charges/0",
Expand All @@ -181,7 +181,7 @@ test("validateJsonConditionals", async (t) => {
{
path: "/standard_charge_information/2/standard_charges/0",
field: "0",
message: 'must match "else" schema',
message: 'must match "then" schema',
},
{
path: "/standard_charge_information/3/standard_charges/0",
Expand All @@ -191,7 +191,7 @@ test("validateJsonConditionals", async (t) => {
{
path: "/standard_charge_information/3/standard_charges/0",
field: "0",
message: 'must match "else" schema',
message: 'must match "then" schema',
},
])
})
Expand Down

0 comments on commit eca314c

Please sign in to comment.