Skip to content

Commit

Permalink
add additionalProperties: false to objects (#435)
Browse files Browse the repository at this point in the history
* add additionalProperties: false to objects

* Revert "add additionalProperties: false to objects"

This reverts commit 4630b51.

* add additionalProperties: false to all objects

* Block: use TransactionInfo instead of TransactionSigned

* TransactionInfo: embedded oneOf schemas - use unevaluatedProperties, remove additionalProperties from child schemas

* Block: add required hash property

* ReceiptInfo: add optional type property

* remove additionalProperties: false from engine APIs
  • Loading branch information
anukul committed Jul 12, 2023
1 parent 6d17705 commit 8fcafbb
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/eth/execute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
schema:
title: Access list result
type: object
additionalProperties: false
properties:
accessList:
title: "accessList"
Expand Down
1 change: 1 addition & 0 deletions src/eth/fee_market.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- oldestBlock
- baseFeePerGas
- gasUsedRatio
additionalProperties: false
properties:
oldestBlock:
title: oldestBlock
Expand Down
8 changes: 7 additions & 1 deletion src/schemas/block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Block:
title: Block object
type: object
required:
- hash
- parentHash
- sha3Uncles
- miner
Expand All @@ -19,7 +20,11 @@ Block:
- size
- transactions
- uncles
additionalProperties: false
properties:
hash:
title: Hash
$ref: '#/components/schemas/hash32'
parentHash:
title: Parent block hash
$ref: '#/components/schemas/hash32'
Expand Down Expand Up @@ -86,7 +91,7 @@ Block:
- title: Full transactions
type: array
items:
$ref: '#/components/schemas/TransactionSigned'
$ref: '#/components/schemas/TransactionInfo'
withdrawals:
title: Withdrawals
type: array
Expand Down Expand Up @@ -130,6 +135,7 @@ BadBlock:
- block
- hash
- rlp
additionalProperties: false
properties:
block:
title: Block
Expand Down
1 change: 1 addition & 0 deletions src/schemas/client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SyncingStatus:
oneOf:
- title: Syncing progress
type: object
additionalProperties: false
properties:
startingBlock:
title: Starting block
Expand Down
1 change: 1 addition & 0 deletions src/schemas/filter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ FilterResults:
Filter:
title: filter
type: object
additionalProperties: false
properties:
fromBlock:
title: from block
Expand Down
5 changes: 5 additions & 0 deletions src/schemas/receipt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Log:
type: object
required:
- transactionHash
additionalProperties: false
properties:
removed:
title: removed
Expand Down Expand Up @@ -47,7 +48,11 @@ ReceiptInfo:
- transactionHash
- transactionIndex
- effectiveGasPrice
additionalProperties: false
properties:
type:
title: type
$ref: '#/components/schemas/byte'
transactionHash:
title: transaction hash
$ref: '#/components/schemas/hash32'
Expand Down
2 changes: 2 additions & 0 deletions src/schemas/state.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ AccountProof:
- nonce
- storageHash
- storageProof
additionalProperties: false
properties:
address:
title: address
Expand Down Expand Up @@ -42,6 +43,7 @@ StorageProof:
- key
- value
- proof
additionalProperties: false
properties:
key:
title: key
Expand Down
3 changes: 3 additions & 0 deletions src/schemas/transaction.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
AccessListEntry:
title: Access list entry
type: object
additionalProperties: false
properties:
address:
$ref: '#/components/schemas/address'
Expand Down Expand Up @@ -224,6 +225,7 @@ TransactionInfo:
- from
- hash
- transactionIndex
unevaluatedProperties: false
properties:
blockHash:
title: block hash
Expand All @@ -244,6 +246,7 @@ TransactionInfo:
GenericTransaction:
type: object
title: Transaction object generic to all types
additionalProperties: false
properties:
type:
title: type
Expand Down
1 change: 1 addition & 0 deletions src/schemas/withdrawal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Withdrawal:
- validatorIndex
- address
- amount
additionalProperties: false
properties:
index:
title: index of withdrawal
Expand Down

0 comments on commit 8fcafbb

Please sign in to comment.