Added openapi response schema for validateaddress

This commit is contained in:
kexkey
2021-11-18 11:23:05 -05:00
parent 4d4bee3fca
commit d42ba92593
2 changed files with 29 additions and 5 deletions

View File

@@ -1201,12 +1201,28 @@ paths:
operationId: "validateAddress"
responses:
'200':
description: "successful operation"
description: "operation successful"
content:
application/json:
schema:
# TODO: describe response
type: "object"
required:
- "isvalid"
properties:
isvalid:
type: "boolean"
address:
$ref: '#/components/schemas/TypeAddressString'
scriptPubKey:
type: "string"
isscript:
type: "boolean"
iswitness:
type: "boolean"
witness_version:
type: "number"
witness_program:
type: "string"
'403':
$ref: '#/components/schemas/ApiResponseNotAllowed'
'503':
@@ -3084,9 +3100,9 @@ components:
type: "string"
pattern: "^[a-fA-F0-9]+$"
TypeAddressString:
description: "base58 check encoded address"
description: "base58 or base32 check encoded address"
type: "string"
pattern: "^[a-km-zA-HJ-NP-Z1-9]{26,35}$"
pattern: "^(bc1|tb1|bcrt1)[ac-hj-np-z02-9]{9,71}|[123mn][a-km-zA-HJ-NP-Z1-9]{26,33}$"
TypeXpubString:
description: "base58 check encoded xpub"
type: "string"