Skip to content

Commit

Permalink
Remove default which only works for 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
charjr committed Nov 1, 2024
1 parent 00bc029 commit f4c5575
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/spec/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ protected function attributeDefaults(): array
// return null as default when there is no type
// return false as default when there is a type
'nullable' => $this->hasPropertyValue('type') ? false : null,
'exclusiveMinimum' => $this->hasPropertyValue('minimum') ? false : null,
'exclusiveMaximum' => $this->hasPropertyValue('maximum') ? false : null,
'exclusiveMinimum' => null,
'exclusiveMaximum' => null,
];
}

Expand Down
4 changes: 2 additions & 2 deletions tests/spec/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testMinMax()
/** @var $schema Schema */
$schema = Reader::readFromJson('{"type": "integer", "minimum": 1}', Schema::class);
$this->assertEquals(1, $schema->minimum);
$this->assertFalse($schema->exclusiveMinimum);
$this->assertNull($schema->exclusiveMinimum);
$this->assertNull($schema->maximum);
$this->assertNull($schema->exclusiveMaximum);

Expand All @@ -92,7 +92,7 @@ public function testMinMax()
/** @var $schema Schema */
$schema = Reader::readFromJson('{"type": "integer", "maximum": 10}', Schema::class);
$this->assertEquals(10, $schema->maximum);
$this->assertFalse($schema->exclusiveMaximum);
$this->assertNull($schema->exclusiveMaximum);
$this->assertNull($schema->minimum);
$this->assertNull($schema->exclusiveMinimum);

Expand Down

0 comments on commit f4c5575

Please sign in to comment.