Make subscription_type, username, and years optional on POST /v1/admin/users
- subscription_type defaults to lifetime when omitted; validated when provided - years is only required (and enforced) when subscription_type is yearly - username uniqueness check and validation are skipped when username is empty - Update OpenAPI spec to reflect pubkey as the only required field
This commit is contained in:
@@ -222,12 +222,12 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [pubkey, username, subscription_type]
|
||||
required: [pubkey]
|
||||
properties:
|
||||
pubkey: { type: string }
|
||||
username: { type: string }
|
||||
subscription_type: { type: string, enum: [yearly, lifetime] }
|
||||
years: { type: integer }
|
||||
username: { type: string, description: "Optional NIP-05 username to assign" }
|
||||
subscription_type: { type: string, enum: [yearly, lifetime], description: "Defaults to lifetime when omitted" }
|
||||
years: { type: integer, description: "Required when subscription_type is yearly" }
|
||||
responses:
|
||||
'201':
|
||||
description: Created
|
||||
|
||||
Reference in New Issue
Block a user