Skip to content

Commit 2f3b54c

Browse files
author
Matheus Luís
committed
FIX: Simplify schema for ServerBasedAPIAccessControl to optionally accept base_url
the proposed discriminated union was not working and would require the creation of a subschema inside this schema, so for simplicity if base_url is included it takes priority over the server+port defaults
1 parent 4a3910f commit 2f3b54c

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

bluesky_httpserver/authorization/api_access.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -469,26 +469,18 @@ def __init__(self, *, roles=None, users=None):
469469
type: string
470470
roles: # Detailed validation is performed elsewhere
471471
description: The value is passed to BasicAPIAccessControl object
472-
oneOf:
473-
- properties:
474-
base_url:
475-
type: string
476-
required:
477-
- base_url
478-
- properties:
479-
server:
480-
type: string
481-
port:
482-
type: integer
483-
required:
484-
- server
485-
- port
472+
server:
473+
type: string
474+
port:
475+
type: integer
486476
update_period:
487477
type: integer
488478
expiration_period:
489479
type: [integer, "null"]
490480
http_timeout:
491481
type: integer
482+
base_url:
483+
type: [string, "null"]
492484
"""
493485

494486

0 commit comments

Comments
 (0)