Files
openapi-first/mcp_docs/modules/openapi_first.loader.json
2026-03-08 00:41:19 +05:30

79 lines
4.6 KiB
JSON

{
"module": "openapi_first.loader",
"content": {
"path": "openapi_first.loader",
"docstring": "OpenAPI specification loading and validation utilities.\n\n---\n\n## Summary\n\nThis module is responsible for loading an OpenAPI 3.x specification\nfrom disk and validating it before it is used by the application.\n\nIt enforces the principle that an invalid or malformed OpenAPI document\nmust never reach the routing or runtime layers.\n\nNotes:\n **Design Principles:**\n\n - OpenAPI is treated as an authoritative contract\n - Invalid specifications fail fast at application startup\n - Supported formats are JSON and YAML\n - Validation errors are surfaced clearly and early\n\n **Constraints:**\n\n - This module intentionally does NOT: Modify the OpenAPI document, infer missing fields, generate models or code, or perform request/response validation at runtime.",
"objects": {
"json": {
"name": "json",
"kind": "alias",
"path": "openapi_first.loader.json",
"signature": "<bound method Alias.signature of Alias('json', 'json')>",
"docstring": null
},
"Path": {
"name": "Path",
"kind": "alias",
"path": "openapi_first.loader.Path",
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
"docstring": null
},
"Any": {
"name": "Any",
"kind": "alias",
"path": "openapi_first.loader.Any",
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
"docstring": null
},
"yaml": {
"name": "yaml",
"kind": "alias",
"path": "openapi_first.loader.yaml",
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
"docstring": null
},
"validate_spec": {
"name": "validate_spec",
"kind": "alias",
"path": "openapi_first.loader.validate_spec",
"signature": "<bound method Alias.signature of Alias('validate_spec', 'openapi_spec_validator.validate_spec')>",
"docstring": null
},
"OpenAPIFirstError": {
"name": "OpenAPIFirstError",
"kind": "class",
"path": "openapi_first.loader.OpenAPIFirstError",
"signature": "<bound method Alias.signature of Alias('OpenAPIFirstError', 'openapi_first.errors.OpenAPIFirstError')>",
"docstring": "Base exception for all OpenAPI-first enforcement errors.\n\nNotes:\n **Responsibilities:**\n\n - This exception exists to allow callers, test suites, and CI pipelines to catch and distinguish OpenAPI contract violations from unrelated runtime errors\n - All exceptions raised by the OpenAPI-first core should inherit from this type"
},
"OpenAPISpecLoadError": {
"name": "OpenAPISpecLoadError",
"kind": "class",
"path": "openapi_first.loader.OpenAPISpecLoadError",
"signature": "<bound method Class.signature of Class('OpenAPISpecLoadError', 37, 46)>",
"docstring": "Raised when an OpenAPI specification cannot be loaded or validated.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the OpenAPI document is unreadable, malformed, or violates the OpenAPI 3.x specification"
},
"load_openapi": {
"name": "load_openapi",
"kind": "function",
"path": "openapi_first.loader.load_openapi",
"signature": "<bound method Function.signature of Function('load_openapi', 49, 102)>",
"docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported extensions: .json, .yaml, .yml.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated using a strict OpenAPI schema validator\n - Any error results in an immediate exception, preventing application startup"
},
"Dict": {
"name": "Dict",
"kind": "alias",
"path": "openapi_first.loader.Dict",
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
"docstring": null
},
"Union": {
"name": "Union",
"kind": "alias",
"path": "openapi_first.loader.Union",
"signature": "<bound method Alias.signature of Alias('Union', 'typing.Union')>",
"docstring": null
}
}
}
}