Releases: aipartnerup/apcore-toolkit-python
Releases · aipartnerup/apcore-toolkit-python
Release 0.3.0
Added
_deep_resolve_refs()— recursive$refresolution for nested OpenAPI schemas,
handlingallOf/anyOf/oneOf,items, andproperties. Depth-limited to 16
levels to prevent infinite recursion on circular references.Enhancerprotocol — pluggable interface for metadata enhancement, allowing
custom enhancers beyond the built-inAIEnhancer.HTTPProxyRegistryWriter— registers scanned modules as HTTP proxy classes
that forward requests to a running web API. Supports path parameter substitution,
pluggable auth headers, and2xxsuccess range (with204returning{}).
Requires optionalhttpxdependency (pip install apcore-toolkit[http-proxy]).get_writer("http-proxy", base_url=...)— factory support for the new
HTTP proxy writer with**kwargsforwarding.- Expanded
__init__.pypublic API: exportsEnhancer,HTTPProxyRegistryWriter,
WriteError,Verifier,VerifyResult, verifier classes, serializer functions,
resolve_ref,resolve_schema,extract_input_schema,extract_output_schema,
andrun_verifier_chain.
Fixed
extract_output_schema()— now recursively resolves all nested$refpointers
(previously only handled the shallow case of array items with$ref).extract_input_schema()— now recursively resolves$refinside individual
properties after assembly.get_writer()return type annotation now includesHTTPProxyRegistryWriter.
Tests
- 272 tests (up from 260), all passing
- Added
TestDeepResolveRefs(8 tests): top-level ref, nested properties,
allOf/anyOf, array items, deeply nested refs, circular ref depth limit,
immutability guarantee - Added nested
$reftests forextract_input_schemaandextract_output_schema - Added
test_http_proxyforget_writer("http-proxy")factory
Release 0.2.0
Added
WriteResultdataclass — structured result type for all writer operations,
with optional output verification supportAIEnhancer— SLM-based metadata enhancement using local OpenAI-compatible
APIs (Ollama, vLLM, LM Studio). Fills missing descriptions, infers behavioral
annotations, and generates input schemas for untyped functions. All AI-generated
fields are tagged withx-generated-by: slmfor auditability.
Annotation inference prompt and acceptance logic extended to handle all 11
annotation fields (5 new:cacheable,cache_ttl,cache_key_fields,
paginated,pagination_style)- Output verification via
verify=Trueparameter on all writers: YAMLWriter: validates YAML parsability and required binding fieldsPythonWriter: validates Python syntax viaast.parse()RegistryWriter: validates module is retrievable after registration- CI matrix expanded to Python 3.11 + 3.12, added mypy and coverage reporting
Changed
- apcore >= 0.13.0 — Upgraded minimum dependency to support new
ModuleAnnotationscaching and pagination fields:
cacheable,cache_ttl,cache_key_fields,paginated,pagination_style infer_annotations_from_method()—GETnow also inferscacheable=True- BREAKING: All writers now return
list[WriteResult]instead of
list[dict](YAMLWriter) orlist[str](PythonWriter, RegistryWriter).
Downstream adapters (django-apcore,flask-apcore) must update code that
accesses writer return values as dicts or strings. Migration: result[0]["bindings"]→ usewriter._build_binding(module)for dict accessresult == ["module.id"]→[r.module_id for r in result] == ["module.id"]f"wrote: {item}"→f"wrote: {item.module_id}"- Downstream packages should pin
apcore-toolkit<0.2.0until updated
Fixed
- README — added 5 concrete verifier classes (
YAMLVerifier,SyntaxVerifier,
RegistryVerifier,MagicBytesVerifier,JSONVerifier) to Core Modules table
for documentation completeness
Tests
- 197 tests (up from 150), all passing
Release 0.1.0
Initial release. Extracts shared framework-agnostic logic from django-apcore
and flask-apcore into a standalone toolkit package.
Added
ScannedModuledataclass — canonical representation of a scanned endpointBaseScannerABC withfilter_modules(),deduplicate_ids(),
infer_annotations_from_method(), andextract_docstring()utilitiesYAMLWriter— generates.binding.yamlfiles forapcore.BindingLoaderPythonWriter— generates@module-decorated Python wrapper filesRegistryWriter— registers modules directly intoapcore.Registryto_markdown()— generic dict-to-Markdown conversion with depth control
and table heuristicsflatten_pydantic_params()— flattens Pydantic model parameters into
scalar kwargs for MCP tool invocationresolve_target()— resolvesmodule.path:qualnametarget stringsenrich_schema_descriptions()— merges docstring parameter descriptions
into JSON Schema propertiesannotations_to_dict()/module_to_dict()— serialization utilities- OpenAPI utilities:
resolve_ref(),resolve_schema(),
extract_input_schema(),extract_output_schema() - Output format factory via
get_writer() - 150 tests with 94% code coverage
Dependencies
- apcore >= 0.9.0
- pydantic >= 2.0
- PyYAML >= 6.0