schemathesis 3.19.7__py3-none-any.whl → 3.20.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- schemathesis/_compat.py +3 -2
- schemathesis/_hypothesis.py +21 -6
- schemathesis/_xml.py +177 -0
- schemathesis/auths.py +48 -10
- schemathesis/cli/__init__.py +77 -19
- schemathesis/cli/callbacks.py +42 -18
- schemathesis/cli/context.py +2 -1
- schemathesis/cli/output/default.py +102 -34
- schemathesis/cli/sanitization.py +15 -0
- schemathesis/code_samples.py +141 -0
- schemathesis/constants.py +1 -24
- schemathesis/exceptions.py +127 -26
- schemathesis/experimental/__init__.py +85 -0
- schemathesis/extra/pytest_plugin.py +10 -4
- schemathesis/fixups/__init__.py +8 -2
- schemathesis/fixups/fast_api.py +11 -1
- schemathesis/fixups/utf8_bom.py +7 -1
- schemathesis/hooks.py +63 -0
- schemathesis/lazy.py +10 -4
- schemathesis/loaders.py +57 -0
- schemathesis/models.py +120 -96
- schemathesis/parameters.py +3 -0
- schemathesis/runner/__init__.py +3 -0
- schemathesis/runner/events.py +55 -20
- schemathesis/runner/impl/core.py +54 -54
- schemathesis/runner/serialization.py +75 -34
- schemathesis/sanitization.py +248 -0
- schemathesis/schemas.py +21 -6
- schemathesis/serializers.py +32 -3
- schemathesis/service/serialization.py +5 -1
- schemathesis/specs/graphql/loaders.py +44 -13
- schemathesis/specs/graphql/schemas.py +56 -25
- schemathesis/specs/openapi/_hypothesis.py +11 -23
- schemathesis/specs/openapi/definitions.py +572 -0
- schemathesis/specs/openapi/loaders.py +100 -49
- schemathesis/specs/openapi/parameters.py +2 -2
- schemathesis/specs/openapi/schemas.py +87 -13
- schemathesis/specs/openapi/security.py +1 -0
- schemathesis/stateful.py +2 -2
- schemathesis/utils.py +30 -9
- schemathesis-3.20.1.dist-info/METADATA +342 -0
- {schemathesis-3.19.7.dist-info → schemathesis-3.20.1.dist-info}/RECORD +45 -39
- schemathesis-3.19.7.dist-info/METADATA +0 -291
- {schemathesis-3.19.7.dist-info → schemathesis-3.20.1.dist-info}/WHEEL +0 -0
- {schemathesis-3.19.7.dist-info → schemathesis-3.20.1.dist-info}/entry_points.txt +0 -0
- {schemathesis-3.19.7.dist-info → schemathesis-3.20.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1324,3 +1324,575 @@ OPENAPI_30 = {
|
|
|
1324
1324
|
},
|
|
1325
1325
|
}
|
|
1326
1326
|
OPENAPI_30_VALIDATOR = jsonschema.validators.validator_for(OPENAPI_30)(OPENAPI_30)
|
|
1327
|
+
|
|
1328
|
+
OPENAPI_31 = {
|
|
1329
|
+
"$id": "https://spec.openapis.org/oas/3.1/schema/2022-10-07",
|
|
1330
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1331
|
+
"description": "The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0",
|
|
1332
|
+
"type": "object",
|
|
1333
|
+
"properties": {
|
|
1334
|
+
"openapi": {"type": "string", "pattern": "^3\\.1\\.\\d+(-.+)?$"},
|
|
1335
|
+
"info": {"$ref": "#/$defs/info"},
|
|
1336
|
+
"jsonSchemaDialect": {
|
|
1337
|
+
"type": "string",
|
|
1338
|
+
"format": "uri",
|
|
1339
|
+
"default": "https://spec.openapis.org/oas/3.1/dialect/base",
|
|
1340
|
+
},
|
|
1341
|
+
"servers": {"type": "array", "items": {"$ref": "#/$defs/server"}, "default": [{"url": "/"}]},
|
|
1342
|
+
"paths": {"$ref": "#/$defs/paths"},
|
|
1343
|
+
"webhooks": {"type": "object", "additionalProperties": {"$ref": "#/$defs/path-item-or-reference"}},
|
|
1344
|
+
"components": {"$ref": "#/$defs/components"},
|
|
1345
|
+
"security": {"type": "array", "items": {"$ref": "#/$defs/security-requirement"}},
|
|
1346
|
+
"tags": {"type": "array", "items": {"$ref": "#/$defs/tag"}},
|
|
1347
|
+
"externalDocs": {"$ref": "#/$defs/external-documentation"},
|
|
1348
|
+
},
|
|
1349
|
+
"required": ["openapi", "info"],
|
|
1350
|
+
"anyOf": [{"required": ["paths"]}, {"required": ["components"]}, {"required": ["webhooks"]}],
|
|
1351
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1352
|
+
"unevaluatedProperties": False,
|
|
1353
|
+
"$defs": {
|
|
1354
|
+
"info": {
|
|
1355
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#info-object",
|
|
1356
|
+
"type": "object",
|
|
1357
|
+
"properties": {
|
|
1358
|
+
"title": {"type": "string"},
|
|
1359
|
+
"summary": {"type": "string"},
|
|
1360
|
+
"description": {"type": "string"},
|
|
1361
|
+
"termsOfService": {"type": "string", "format": "uri"},
|
|
1362
|
+
"contact": {"$ref": "#/$defs/contact"},
|
|
1363
|
+
"license": {"$ref": "#/$defs/license"},
|
|
1364
|
+
"version": {"type": "string"},
|
|
1365
|
+
},
|
|
1366
|
+
"required": ["title", "version"],
|
|
1367
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1368
|
+
"unevaluatedProperties": False,
|
|
1369
|
+
},
|
|
1370
|
+
"contact": {
|
|
1371
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#contact-object",
|
|
1372
|
+
"type": "object",
|
|
1373
|
+
"properties": {
|
|
1374
|
+
"name": {"type": "string"},
|
|
1375
|
+
"url": {"type": "string", "format": "uri"},
|
|
1376
|
+
"email": {"type": "string", "format": "email"},
|
|
1377
|
+
},
|
|
1378
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1379
|
+
"unevaluatedProperties": False,
|
|
1380
|
+
},
|
|
1381
|
+
"license": {
|
|
1382
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#license-object",
|
|
1383
|
+
"type": "object",
|
|
1384
|
+
"properties": {
|
|
1385
|
+
"name": {"type": "string"},
|
|
1386
|
+
"identifier": {"type": "string"},
|
|
1387
|
+
"url": {"type": "string", "format": "uri"},
|
|
1388
|
+
},
|
|
1389
|
+
"required": ["name"],
|
|
1390
|
+
"dependentSchemas": {"identifier": {"not": {"required": ["url"]}}},
|
|
1391
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1392
|
+
"unevaluatedProperties": False,
|
|
1393
|
+
},
|
|
1394
|
+
"server": {
|
|
1395
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#server-object",
|
|
1396
|
+
"type": "object",
|
|
1397
|
+
"properties": {
|
|
1398
|
+
"url": {"type": "string", "format": "uri-reference"},
|
|
1399
|
+
"description": {"type": "string"},
|
|
1400
|
+
"variables": {"type": "object", "additionalProperties": {"$ref": "#/$defs/server-variable"}},
|
|
1401
|
+
},
|
|
1402
|
+
"required": ["url"],
|
|
1403
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1404
|
+
"unevaluatedProperties": False,
|
|
1405
|
+
},
|
|
1406
|
+
"server-variable": {
|
|
1407
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#server-variable-object",
|
|
1408
|
+
"type": "object",
|
|
1409
|
+
"properties": {
|
|
1410
|
+
"enum": {"type": "array", "items": {"type": "string"}, "minItems": 1},
|
|
1411
|
+
"default": {"type": "string"},
|
|
1412
|
+
"description": {"type": "string"},
|
|
1413
|
+
},
|
|
1414
|
+
"required": ["default"],
|
|
1415
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1416
|
+
"unevaluatedProperties": False,
|
|
1417
|
+
},
|
|
1418
|
+
"components": {
|
|
1419
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#components-object",
|
|
1420
|
+
"type": "object",
|
|
1421
|
+
"properties": {
|
|
1422
|
+
"schemas": {"type": "object", "additionalProperties": {"$dynamicRef": "#meta"}},
|
|
1423
|
+
"responses": {"type": "object", "additionalProperties": {"$ref": "#/$defs/response-or-reference"}},
|
|
1424
|
+
"parameters": {"type": "object", "additionalProperties": {"$ref": "#/$defs/parameter-or-reference"}},
|
|
1425
|
+
"examples": {"type": "object", "additionalProperties": {"$ref": "#/$defs/example-or-reference"}},
|
|
1426
|
+
"requestBodies": {
|
|
1427
|
+
"type": "object",
|
|
1428
|
+
"additionalProperties": {"$ref": "#/$defs/request-body-or-reference"},
|
|
1429
|
+
},
|
|
1430
|
+
"headers": {"type": "object", "additionalProperties": {"$ref": "#/$defs/header-or-reference"}},
|
|
1431
|
+
"securitySchemes": {
|
|
1432
|
+
"type": "object",
|
|
1433
|
+
"additionalProperties": {"$ref": "#/$defs/security-scheme-or-reference"},
|
|
1434
|
+
},
|
|
1435
|
+
"links": {"type": "object", "additionalProperties": {"$ref": "#/$defs/link-or-reference"}},
|
|
1436
|
+
"callbacks": {"type": "object", "additionalProperties": {"$ref": "#/$defs/callbacks-or-reference"}},
|
|
1437
|
+
"pathItems": {"type": "object", "additionalProperties": {"$ref": "#/$defs/path-item-or-reference"}},
|
|
1438
|
+
},
|
|
1439
|
+
"patternProperties": {
|
|
1440
|
+
"^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$": {
|
|
1441
|
+
"$comment": "Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected",
|
|
1442
|
+
"propertyNames": {"pattern": "^[a-zA-Z0-9._-]+$"},
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1446
|
+
"unevaluatedProperties": False,
|
|
1447
|
+
},
|
|
1448
|
+
"paths": {
|
|
1449
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#paths-object",
|
|
1450
|
+
"type": "object",
|
|
1451
|
+
"patternProperties": {"^/": {"$ref": "#/$defs/path-item"}},
|
|
1452
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1453
|
+
"unevaluatedProperties": False,
|
|
1454
|
+
},
|
|
1455
|
+
"path-item": {
|
|
1456
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#path-item-object",
|
|
1457
|
+
"type": "object",
|
|
1458
|
+
"properties": {
|
|
1459
|
+
"summary": {"type": "string"},
|
|
1460
|
+
"description": {"type": "string"},
|
|
1461
|
+
"servers": {"type": "array", "items": {"$ref": "#/$defs/server"}},
|
|
1462
|
+
"parameters": {"type": "array", "items": {"$ref": "#/$defs/parameter-or-reference"}},
|
|
1463
|
+
"get": {"$ref": "#/$defs/operation"},
|
|
1464
|
+
"put": {"$ref": "#/$defs/operation"},
|
|
1465
|
+
"post": {"$ref": "#/$defs/operation"},
|
|
1466
|
+
"delete": {"$ref": "#/$defs/operation"},
|
|
1467
|
+
"options": {"$ref": "#/$defs/operation"},
|
|
1468
|
+
"head": {"$ref": "#/$defs/operation"},
|
|
1469
|
+
"patch": {"$ref": "#/$defs/operation"},
|
|
1470
|
+
"trace": {"$ref": "#/$defs/operation"},
|
|
1471
|
+
},
|
|
1472
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1473
|
+
"unevaluatedProperties": False,
|
|
1474
|
+
},
|
|
1475
|
+
"path-item-or-reference": {
|
|
1476
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1477
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1478
|
+
"else": {"$ref": "#/$defs/path-item"},
|
|
1479
|
+
},
|
|
1480
|
+
"operation": {
|
|
1481
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#operation-object",
|
|
1482
|
+
"type": "object",
|
|
1483
|
+
"properties": {
|
|
1484
|
+
"tags": {"type": "array", "items": {"type": "string"}},
|
|
1485
|
+
"summary": {"type": "string"},
|
|
1486
|
+
"description": {"type": "string"},
|
|
1487
|
+
"externalDocs": {"$ref": "#/$defs/external-documentation"},
|
|
1488
|
+
"operationId": {"type": "string"},
|
|
1489
|
+
"parameters": {"type": "array", "items": {"$ref": "#/$defs/parameter-or-reference"}},
|
|
1490
|
+
"requestBody": {"$ref": "#/$defs/request-body-or-reference"},
|
|
1491
|
+
"responses": {"$ref": "#/$defs/responses"},
|
|
1492
|
+
"callbacks": {"type": "object", "additionalProperties": {"$ref": "#/$defs/callbacks-or-reference"}},
|
|
1493
|
+
"deprecated": {"default": False, "type": "boolean"},
|
|
1494
|
+
"security": {"type": "array", "items": {"$ref": "#/$defs/security-requirement"}},
|
|
1495
|
+
"servers": {"type": "array", "items": {"$ref": "#/$defs/server"}},
|
|
1496
|
+
},
|
|
1497
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1498
|
+
"unevaluatedProperties": False,
|
|
1499
|
+
},
|
|
1500
|
+
"external-documentation": {
|
|
1501
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#external-documentation-object",
|
|
1502
|
+
"type": "object",
|
|
1503
|
+
"properties": {"description": {"type": "string"}, "url": {"type": "string", "format": "uri"}},
|
|
1504
|
+
"required": ["url"],
|
|
1505
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1506
|
+
"unevaluatedProperties": False,
|
|
1507
|
+
},
|
|
1508
|
+
"parameter": {
|
|
1509
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#parameter-object",
|
|
1510
|
+
"type": "object",
|
|
1511
|
+
"properties": {
|
|
1512
|
+
"name": {"type": "string"},
|
|
1513
|
+
"in": {"enum": ["query", "header", "path", "cookie"]},
|
|
1514
|
+
"description": {"type": "string"},
|
|
1515
|
+
"required": {"default": False, "type": "boolean"},
|
|
1516
|
+
"deprecated": {"default": False, "type": "boolean"},
|
|
1517
|
+
"schema": {"$dynamicRef": "#meta"},
|
|
1518
|
+
"content": {"$ref": "#/$defs/content", "minProperties": 1, "maxProperties": 1},
|
|
1519
|
+
},
|
|
1520
|
+
"required": ["name", "in"],
|
|
1521
|
+
"oneOf": [{"required": ["schema"]}, {"required": ["content"]}],
|
|
1522
|
+
"if": {"properties": {"in": {"const": "query"}}, "required": ["in"]},
|
|
1523
|
+
"then": {"properties": {"allowEmptyValue": {"default": False, "type": "boolean"}}},
|
|
1524
|
+
"dependentSchemas": {
|
|
1525
|
+
"schema": {
|
|
1526
|
+
"properties": {"style": {"type": "string"}, "explode": {"type": "boolean"}},
|
|
1527
|
+
"allOf": [
|
|
1528
|
+
{"$ref": "#/$defs/examples"},
|
|
1529
|
+
{"$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path"},
|
|
1530
|
+
{"$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header"},
|
|
1531
|
+
{"$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query"},
|
|
1532
|
+
{"$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie"},
|
|
1533
|
+
{"$ref": "#/$defs/styles-for-form"},
|
|
1534
|
+
],
|
|
1535
|
+
"$defs": {
|
|
1536
|
+
"styles-for-path": {
|
|
1537
|
+
"if": {"properties": {"in": {"const": "path"}}, "required": ["in"]},
|
|
1538
|
+
"then": {
|
|
1539
|
+
"properties": {
|
|
1540
|
+
"name": {"pattern": "[^/#?]+$"},
|
|
1541
|
+
"style": {"default": "simple", "enum": ["matrix", "label", "simple"]},
|
|
1542
|
+
"required": {"const": True},
|
|
1543
|
+
},
|
|
1544
|
+
"required": ["required"],
|
|
1545
|
+
},
|
|
1546
|
+
},
|
|
1547
|
+
"styles-for-header": {
|
|
1548
|
+
"if": {"properties": {"in": {"const": "header"}}, "required": ["in"]},
|
|
1549
|
+
"then": {"properties": {"style": {"default": "simple", "const": "simple"}}},
|
|
1550
|
+
},
|
|
1551
|
+
"styles-for-query": {
|
|
1552
|
+
"if": {"properties": {"in": {"const": "query"}}, "required": ["in"]},
|
|
1553
|
+
"then": {
|
|
1554
|
+
"properties": {
|
|
1555
|
+
"style": {
|
|
1556
|
+
"default": "form",
|
|
1557
|
+
"enum": ["form", "spaceDelimited", "pipeDelimited", "deepObject"],
|
|
1558
|
+
},
|
|
1559
|
+
"allowReserved": {"default": False, "type": "boolean"},
|
|
1560
|
+
}
|
|
1561
|
+
},
|
|
1562
|
+
},
|
|
1563
|
+
"styles-for-cookie": {
|
|
1564
|
+
"if": {"properties": {"in": {"const": "cookie"}}, "required": ["in"]},
|
|
1565
|
+
"then": {"properties": {"style": {"default": "form", "const": "form"}}},
|
|
1566
|
+
},
|
|
1567
|
+
},
|
|
1568
|
+
}
|
|
1569
|
+
},
|
|
1570
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1571
|
+
"unevaluatedProperties": False,
|
|
1572
|
+
},
|
|
1573
|
+
"parameter-or-reference": {
|
|
1574
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1575
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1576
|
+
"else": {"$ref": "#/$defs/parameter"},
|
|
1577
|
+
},
|
|
1578
|
+
"request-body": {
|
|
1579
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#request-body-object",
|
|
1580
|
+
"type": "object",
|
|
1581
|
+
"properties": {
|
|
1582
|
+
"description": {"type": "string"},
|
|
1583
|
+
"content": {"$ref": "#/$defs/content"},
|
|
1584
|
+
"required": {"default": False, "type": "boolean"},
|
|
1585
|
+
},
|
|
1586
|
+
"required": ["content"],
|
|
1587
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1588
|
+
"unevaluatedProperties": False,
|
|
1589
|
+
},
|
|
1590
|
+
"request-body-or-reference": {
|
|
1591
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1592
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1593
|
+
"else": {"$ref": "#/$defs/request-body"},
|
|
1594
|
+
},
|
|
1595
|
+
"content": {
|
|
1596
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#fixed-fields-10",
|
|
1597
|
+
"type": "object",
|
|
1598
|
+
"additionalProperties": {"$ref": "#/$defs/media-type"},
|
|
1599
|
+
"propertyNames": {"format": "media-range"},
|
|
1600
|
+
},
|
|
1601
|
+
"media-type": {
|
|
1602
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#media-type-object",
|
|
1603
|
+
"type": "object",
|
|
1604
|
+
"properties": {
|
|
1605
|
+
"schema": {"$dynamicRef": "#meta"},
|
|
1606
|
+
"encoding": {"type": "object", "additionalProperties": {"$ref": "#/$defs/encoding"}},
|
|
1607
|
+
},
|
|
1608
|
+
"allOf": [{"$ref": "#/$defs/specification-extensions"}, {"$ref": "#/$defs/examples"}],
|
|
1609
|
+
"unevaluatedProperties": False,
|
|
1610
|
+
},
|
|
1611
|
+
"encoding": {
|
|
1612
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#encoding-object",
|
|
1613
|
+
"type": "object",
|
|
1614
|
+
"properties": {
|
|
1615
|
+
"contentType": {"type": "string", "format": "media-range"},
|
|
1616
|
+
"headers": {"type": "object", "additionalProperties": {"$ref": "#/$defs/header-or-reference"}},
|
|
1617
|
+
"style": {"default": "form", "enum": ["form", "spaceDelimited", "pipeDelimited", "deepObject"]},
|
|
1618
|
+
"explode": {"type": "boolean"},
|
|
1619
|
+
"allowReserved": {"default": False, "type": "boolean"},
|
|
1620
|
+
},
|
|
1621
|
+
"allOf": [{"$ref": "#/$defs/specification-extensions"}, {"$ref": "#/$defs/styles-for-form"}],
|
|
1622
|
+
"unevaluatedProperties": False,
|
|
1623
|
+
},
|
|
1624
|
+
"responses": {
|
|
1625
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#responses-object",
|
|
1626
|
+
"type": "object",
|
|
1627
|
+
"properties": {"default": {"$ref": "#/$defs/response-or-reference"}},
|
|
1628
|
+
"patternProperties": {"^[1-5](?:[0-9]{2}|XX)$": {"$ref": "#/$defs/response-or-reference"}},
|
|
1629
|
+
"minProperties": 1,
|
|
1630
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1631
|
+
"unevaluatedProperties": False,
|
|
1632
|
+
"if": {
|
|
1633
|
+
"$comment": "either default, or at least one response code property must exist",
|
|
1634
|
+
"patternProperties": {"^[1-5](?:[0-9]{2}|XX)$": False},
|
|
1635
|
+
},
|
|
1636
|
+
"then": {"required": ["default"]},
|
|
1637
|
+
},
|
|
1638
|
+
"response": {
|
|
1639
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#response-object",
|
|
1640
|
+
"type": "object",
|
|
1641
|
+
"properties": {
|
|
1642
|
+
"description": {"type": "string"},
|
|
1643
|
+
"headers": {"type": "object", "additionalProperties": {"$ref": "#/$defs/header-or-reference"}},
|
|
1644
|
+
"content": {"$ref": "#/$defs/content"},
|
|
1645
|
+
"links": {"type": "object", "additionalProperties": {"$ref": "#/$defs/link-or-reference"}},
|
|
1646
|
+
},
|
|
1647
|
+
"required": ["description"],
|
|
1648
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1649
|
+
"unevaluatedProperties": False,
|
|
1650
|
+
},
|
|
1651
|
+
"response-or-reference": {
|
|
1652
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1653
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1654
|
+
"else": {"$ref": "#/$defs/response"},
|
|
1655
|
+
},
|
|
1656
|
+
"callbacks": {
|
|
1657
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#callback-object",
|
|
1658
|
+
"type": "object",
|
|
1659
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1660
|
+
"additionalProperties": {"$ref": "#/$defs/path-item-or-reference"},
|
|
1661
|
+
},
|
|
1662
|
+
"callbacks-or-reference": {
|
|
1663
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1664
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1665
|
+
"else": {"$ref": "#/$defs/callbacks"},
|
|
1666
|
+
},
|
|
1667
|
+
"example": {
|
|
1668
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#example-object",
|
|
1669
|
+
"type": "object",
|
|
1670
|
+
"properties": {
|
|
1671
|
+
"summary": {"type": "string"},
|
|
1672
|
+
"description": {"type": "string"},
|
|
1673
|
+
"value": True,
|
|
1674
|
+
"externalValue": {"type": "string", "format": "uri"},
|
|
1675
|
+
},
|
|
1676
|
+
"not": {"required": ["value", "externalValue"]},
|
|
1677
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1678
|
+
"unevaluatedProperties": False,
|
|
1679
|
+
},
|
|
1680
|
+
"example-or-reference": {
|
|
1681
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1682
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1683
|
+
"else": {"$ref": "#/$defs/example"},
|
|
1684
|
+
},
|
|
1685
|
+
"link": {
|
|
1686
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#link-object",
|
|
1687
|
+
"type": "object",
|
|
1688
|
+
"properties": {
|
|
1689
|
+
"operationRef": {"type": "string", "format": "uri-reference"},
|
|
1690
|
+
"operationId": {"type": "string"},
|
|
1691
|
+
"parameters": {"$ref": "#/$defs/map-of-strings"},
|
|
1692
|
+
"requestBody": True,
|
|
1693
|
+
"description": {"type": "string"},
|
|
1694
|
+
"body": {"$ref": "#/$defs/server"},
|
|
1695
|
+
},
|
|
1696
|
+
"oneOf": [{"required": ["operationRef"]}, {"required": ["operationId"]}],
|
|
1697
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1698
|
+
"unevaluatedProperties": False,
|
|
1699
|
+
},
|
|
1700
|
+
"link-or-reference": {
|
|
1701
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1702
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1703
|
+
"else": {"$ref": "#/$defs/link"},
|
|
1704
|
+
},
|
|
1705
|
+
"header": {
|
|
1706
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#header-object",
|
|
1707
|
+
"type": "object",
|
|
1708
|
+
"properties": {
|
|
1709
|
+
"description": {"type": "string"},
|
|
1710
|
+
"required": {"default": False, "type": "boolean"},
|
|
1711
|
+
"deprecated": {"default": False, "type": "boolean"},
|
|
1712
|
+
"schema": {"$dynamicRef": "#meta"},
|
|
1713
|
+
"content": {"$ref": "#/$defs/content", "minProperties": 1, "maxProperties": 1},
|
|
1714
|
+
},
|
|
1715
|
+
"oneOf": [{"required": ["schema"]}, {"required": ["content"]}],
|
|
1716
|
+
"dependentSchemas": {
|
|
1717
|
+
"schema": {
|
|
1718
|
+
"properties": {
|
|
1719
|
+
"style": {"default": "simple", "const": "simple"},
|
|
1720
|
+
"explode": {"default": False, "type": "boolean"},
|
|
1721
|
+
},
|
|
1722
|
+
"$ref": "#/$defs/examples",
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1726
|
+
"unevaluatedProperties": False,
|
|
1727
|
+
},
|
|
1728
|
+
"header-or-reference": {
|
|
1729
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1730
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1731
|
+
"else": {"$ref": "#/$defs/header"},
|
|
1732
|
+
},
|
|
1733
|
+
"tag": {
|
|
1734
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#tag-object",
|
|
1735
|
+
"type": "object",
|
|
1736
|
+
"properties": {
|
|
1737
|
+
"name": {"type": "string"},
|
|
1738
|
+
"description": {"type": "string"},
|
|
1739
|
+
"externalDocs": {"$ref": "#/$defs/external-documentation"},
|
|
1740
|
+
},
|
|
1741
|
+
"required": ["name"],
|
|
1742
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1743
|
+
"unevaluatedProperties": False,
|
|
1744
|
+
},
|
|
1745
|
+
"reference": {
|
|
1746
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#reference-object",
|
|
1747
|
+
"type": "object",
|
|
1748
|
+
"properties": {
|
|
1749
|
+
"$ref": {"type": "string", "format": "uri-reference"},
|
|
1750
|
+
"summary": {"type": "string"},
|
|
1751
|
+
"description": {"type": "string"},
|
|
1752
|
+
},
|
|
1753
|
+
"unevaluatedProperties": False,
|
|
1754
|
+
},
|
|
1755
|
+
"schema": {
|
|
1756
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#schema-object",
|
|
1757
|
+
"$dynamicAnchor": "meta",
|
|
1758
|
+
"type": ["object", "boolean"],
|
|
1759
|
+
},
|
|
1760
|
+
"security-scheme": {
|
|
1761
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#security-scheme-object",
|
|
1762
|
+
"type": "object",
|
|
1763
|
+
"properties": {
|
|
1764
|
+
"type": {"enum": ["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]},
|
|
1765
|
+
"description": {"type": "string"},
|
|
1766
|
+
},
|
|
1767
|
+
"required": ["type"],
|
|
1768
|
+
"allOf": [
|
|
1769
|
+
{"$ref": "#/$defs/specification-extensions"},
|
|
1770
|
+
{"$ref": "#/$defs/security-scheme/$defs/type-apikey"},
|
|
1771
|
+
{"$ref": "#/$defs/security-scheme/$defs/type-http"},
|
|
1772
|
+
{"$ref": "#/$defs/security-scheme/$defs/type-http-bearer"},
|
|
1773
|
+
{"$ref": "#/$defs/security-scheme/$defs/type-oauth2"},
|
|
1774
|
+
{"$ref": "#/$defs/security-scheme/$defs/type-oidc"},
|
|
1775
|
+
],
|
|
1776
|
+
"unevaluatedProperties": False,
|
|
1777
|
+
"$defs": {
|
|
1778
|
+
"type-apikey": {
|
|
1779
|
+
"if": {"properties": {"type": {"const": "apiKey"}}, "required": ["type"]},
|
|
1780
|
+
"then": {
|
|
1781
|
+
"properties": {"name": {"type": "string"}, "in": {"enum": ["query", "header", "cookie"]}},
|
|
1782
|
+
"required": ["name", "in"],
|
|
1783
|
+
},
|
|
1784
|
+
},
|
|
1785
|
+
"type-http": {
|
|
1786
|
+
"if": {"properties": {"type": {"const": "http"}}, "required": ["type"]},
|
|
1787
|
+
"then": {"properties": {"scheme": {"type": "string"}}, "required": ["scheme"]},
|
|
1788
|
+
},
|
|
1789
|
+
"type-http-bearer": {
|
|
1790
|
+
"if": {
|
|
1791
|
+
"properties": {
|
|
1792
|
+
"type": {"const": "http"},
|
|
1793
|
+
"scheme": {"type": "string", "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$"},
|
|
1794
|
+
},
|
|
1795
|
+
"required": ["type", "scheme"],
|
|
1796
|
+
},
|
|
1797
|
+
"then": {"properties": {"bearerFormat": {"type": "string"}}},
|
|
1798
|
+
},
|
|
1799
|
+
"type-oauth2": {
|
|
1800
|
+
"if": {"properties": {"type": {"const": "oauth2"}}, "required": ["type"]},
|
|
1801
|
+
"then": {"properties": {"flows": {"$ref": "#/$defs/oauth-flows"}}, "required": ["flows"]},
|
|
1802
|
+
},
|
|
1803
|
+
"type-oidc": {
|
|
1804
|
+
"if": {"properties": {"type": {"const": "openIdConnect"}}, "required": ["type"]},
|
|
1805
|
+
"then": {
|
|
1806
|
+
"properties": {"openIdConnectUrl": {"type": "string", "format": "uri"}},
|
|
1807
|
+
"required": ["openIdConnectUrl"],
|
|
1808
|
+
},
|
|
1809
|
+
},
|
|
1810
|
+
},
|
|
1811
|
+
},
|
|
1812
|
+
"security-scheme-or-reference": {
|
|
1813
|
+
"if": {"type": "object", "required": ["$ref"]},
|
|
1814
|
+
"then": {"$ref": "#/$defs/reference"},
|
|
1815
|
+
"else": {"$ref": "#/$defs/security-scheme"},
|
|
1816
|
+
},
|
|
1817
|
+
"oauth-flows": {
|
|
1818
|
+
"type": "object",
|
|
1819
|
+
"properties": {
|
|
1820
|
+
"implicit": {"$ref": "#/$defs/oauth-flows/$defs/implicit"},
|
|
1821
|
+
"password": {"$ref": "#/$defs/oauth-flows/$defs/password"},
|
|
1822
|
+
"clientCredentials": {"$ref": "#/$defs/oauth-flows/$defs/client-credentials"},
|
|
1823
|
+
"authorizationCode": {"$ref": "#/$defs/oauth-flows/$defs/authorization-code"},
|
|
1824
|
+
},
|
|
1825
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1826
|
+
"unevaluatedProperties": False,
|
|
1827
|
+
"$defs": {
|
|
1828
|
+
"implicit": {
|
|
1829
|
+
"type": "object",
|
|
1830
|
+
"properties": {
|
|
1831
|
+
"authorizationUrl": {"type": "string", "format": "uri"},
|
|
1832
|
+
"refreshUrl": {"type": "string", "format": "uri"},
|
|
1833
|
+
"scopes": {"$ref": "#/$defs/map-of-strings"},
|
|
1834
|
+
},
|
|
1835
|
+
"required": ["authorizationUrl", "scopes"],
|
|
1836
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1837
|
+
"unevaluatedProperties": False,
|
|
1838
|
+
},
|
|
1839
|
+
"password": {
|
|
1840
|
+
"type": "object",
|
|
1841
|
+
"properties": {
|
|
1842
|
+
"tokenUrl": {"type": "string", "format": "uri"},
|
|
1843
|
+
"refreshUrl": {"type": "string", "format": "uri"},
|
|
1844
|
+
"scopes": {"$ref": "#/$defs/map-of-strings"},
|
|
1845
|
+
},
|
|
1846
|
+
"required": ["tokenUrl", "scopes"],
|
|
1847
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1848
|
+
"unevaluatedProperties": False,
|
|
1849
|
+
},
|
|
1850
|
+
"client-credentials": {
|
|
1851
|
+
"type": "object",
|
|
1852
|
+
"properties": {
|
|
1853
|
+
"tokenUrl": {"type": "string", "format": "uri"},
|
|
1854
|
+
"refreshUrl": {"type": "string", "format": "uri"},
|
|
1855
|
+
"scopes": {"$ref": "#/$defs/map-of-strings"},
|
|
1856
|
+
},
|
|
1857
|
+
"required": ["tokenUrl", "scopes"],
|
|
1858
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1859
|
+
"unevaluatedProperties": False,
|
|
1860
|
+
},
|
|
1861
|
+
"authorization-code": {
|
|
1862
|
+
"type": "object",
|
|
1863
|
+
"properties": {
|
|
1864
|
+
"authorizationUrl": {"type": "string", "format": "uri"},
|
|
1865
|
+
"tokenUrl": {"type": "string", "format": "uri"},
|
|
1866
|
+
"refreshUrl": {"type": "string", "format": "uri"},
|
|
1867
|
+
"scopes": {"$ref": "#/$defs/map-of-strings"},
|
|
1868
|
+
},
|
|
1869
|
+
"required": ["authorizationUrl", "tokenUrl", "scopes"],
|
|
1870
|
+
"$ref": "#/$defs/specification-extensions",
|
|
1871
|
+
"unevaluatedProperties": False,
|
|
1872
|
+
},
|
|
1873
|
+
},
|
|
1874
|
+
},
|
|
1875
|
+
"security-requirement": {
|
|
1876
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#security-requirement-object",
|
|
1877
|
+
"type": "object",
|
|
1878
|
+
"additionalProperties": {"type": "array", "items": {"type": "string"}},
|
|
1879
|
+
},
|
|
1880
|
+
"specification-extensions": {
|
|
1881
|
+
"$comment": "https://spec.openapis.org/oas/v3.1.0#specification-extensions",
|
|
1882
|
+
"patternProperties": {"^x-": True},
|
|
1883
|
+
},
|
|
1884
|
+
"examples": {
|
|
1885
|
+
"properties": {
|
|
1886
|
+
"example": True,
|
|
1887
|
+
"examples": {"type": "object", "additionalProperties": {"$ref": "#/$defs/example-or-reference"}},
|
|
1888
|
+
}
|
|
1889
|
+
},
|
|
1890
|
+
"map-of-strings": {"type": "object", "additionalProperties": {"type": "string"}},
|
|
1891
|
+
"styles-for-form": {
|
|
1892
|
+
"if": {"properties": {"style": {"const": "form"}}, "required": ["style"]},
|
|
1893
|
+
"then": {"properties": {"explode": {"default": True}}},
|
|
1894
|
+
"else": {"properties": {"explode": {"default": False}}},
|
|
1895
|
+
},
|
|
1896
|
+
},
|
|
1897
|
+
}
|
|
1898
|
+
OPENAPI_31_VALIDATOR = jsonschema.validators.validator_for(OPENAPI_31)(OPENAPI_31)
|