Chenile 2.1.37 in development
Not released. The framework working copies have moved to 2.1.37 after 2.1.36 was published to Maven Central.
This initial development commit aligns version references only. There is no 2.1.37 release tag or Maven Central deployment. Use 2.1.36 for applications that resolve published framework artifacts.
Changes so far
Pluggable transformers: any payload, JSON by default
The transformation step of the chenile-highway is now an interpolation,
transformersInterpolation, instead of a fixed transformer command. It runs
the Spring beans named in the new chenile.transformers property, in order.
- The default is
chenile.transformers=jsonTransformer, so existing applications behave exactly as before with no configuration change. Transformeris renamed toJsonTransformer(beanjsonTransformer).- Add transformers for XML, CSV, Protobuf or any other format, or replace JSON
entirely, for example
chenile.transformers=xmlTransformer,jsonTransformer. A transformer for another text format goes beforejsonTransformer. - Transformer names are validated at startup, like the other deployable-wide interceptors.
Upgrade note: code or custom chenile-core.xml flows that reference the
Transformer class or the <transformer/> tag must switch to JsonTransformer
and <transformers-interpolation/>.
See runtime internals.
Polymorphic contracts, defined once (ADR 0001, phases 1 and 2)
An operation’s contract (name, description and, for a polymorphic operation, its variants) is now resolved once in chenile-core and published the same way to MCP and OpenAPI.
@ChenilePolymorph,ChenilePolymorphProviderandChenilePolymorphVariantmoved from chenile-mcp toorg.chenile.core.polymorph. A variant has a completename(wasnameSuffix; the provider helpervariantName(op, suffix)gives<contractName>_<suffix>),java.lang.reflect.Typeparameter types, an optional body discriminator and the authorities it needs.- A body type selector that implements
ChenilePolymorphProvidermakes its operation polymorphic with no annotation.SubclassBodyTypeSelectordoes: one variant per subclass registered inSubclassRegistry. @ChenileOperation(contractName, description)(also read on HTTP controller methods),@ChenileController(description)and JSONcontractName,descriptionandpolymorphreplace@ChenileMCP(name, description);@ChenileMCPis now a marker.- The typing step records each request’s variant (
ChenileExchange.getPolymorphVariant()), and falls back to the default body type when a selector sets none (chenile.transform.selector-fallback, defaulttrue). - New
ChenileJsonSchemaGenerator(JSON Schema Draft 2020-12, victools 5) used by MCP and OpenAPI. - New
ChenileOpenApiCustomizerin chenile-http: contract names and descriptions as operation ids and summaries, one path per variant selected by a path variable (for examplePOST /q/students),oneOfbodies for header or body-field variants, andx-chenile-authorities. - Query:
QueryPolymorphmoved to chenile-query-service and the baseQueryControlleris polymorphic (querySearch); the MCP query controller ismcpQuerySearch.
Authorities per polymorph variant (ADR 0001, phase 3)
SecurityConfigServiceImpl (chenile-security) now guards a polymorphic operation with the authorities of the
request’s variant when the variant lists any, before @SecurityConfig(authorities) and
@SecurityConfig(authoritiesSupplier). A plain @SecurityConfig on the operation is enough; the provider decides
what each variant needs.
Workflows and queries publish their own variants (ADR 0001, phase 4)
StmBodyTypeSelectoris now aChenilePolymorphProvider: one variant per event (<contractName>_<eventId>), typed by the event’s payload and guarded by itsmeta-acls. Workflow MCP tools, OpenAPI event paths and per-event authorization need no extra beans.QueryPolymorphpublishes each query’saclsas the variant’s authorities and resolves each request against the current tenant’s definition, so tenant-specific ACLs apply.- Removed:
StmAuthoritiesBuilder,ProcessIdPolymorph, workflow-service’sChenileOpenApiConfigurationand thequeryAuthoritiesbean. Replace@SecurityConfig(authoritiesSupplier = "<svc>EventAuthoritiesSupplier")with@SecurityConfig, drop the<svc>EventAuthoritiesSupplierand<svc>ProcessIdPolymorphbeans and the@ChenilePolymorph("<svc>ProcessIdPolymorph")annotation. The workflow default ACL (<bean>_<event>when an event has nometa-acls) moves fromnew StmAuthoritiesBuilder(provider, true)tostmBodyTypeSelector.setDefaultAclRequired(true). It now uses the service’s configured implementation bean, even when a trajectory orServiceSelectorpicks another bean for a request.workflow-mcpremains as a dependency-only module.
The registry holds the whole contract (ADR 0001, phase 5)
- Published service definitions now carry each operation’s
contractName, request and response JSON Schemas and variants, plus the service’s shared schemas, generated by the publishing deployable withChenileJsonSchemaGenerator. - The registry serves an aggregated OpenAPI 3.1 document for the whole system,
GET /serviceregistry/openapi, and one per service,GET /serviceregistry/{serviceId}/openapi. - Database: new columns
service_definition.shared_schemasandoperation_definition.request_schema,response_schemaandvariant_definitions(text), plusoperation_definition.contract_name. Add them if Hibernate does not manage the registry’s schema. ServiceRegistryClientImplnow serializes with Jackson 3.
Query: safer sorting and server-only system filters
Two fixes to the query request handling in query-api (AbstractSearchServiceImpl, SearchRequest):
- Sorting is limited to sortable columns. Sort names are written into the SQL as identifiers (the
${orderby}fragment), so a sort on a column that the query’s definition does not mark"sortable": trueis now rejected with400(Q724) before any SQL runs. Before, any name was accepted, which allowed SQL injection throughsortCriteria[].name. Positional (index) sorting is unchanged, and sort criteria on a query that is not sortable are still ignored. - System filters belong to the server.
systemFiltersis no longer read from a client’s JSON; it is set only on the server, for example byqueryUserFilterInterceptor(authIds). NeithercustomVariablesnorfilterscan replace a system filter, andcustomVariablescannot replace the to-do-list state filter. Before, a client could sendcustomVariables.authIdsand widen what it was allowed to see.
Upgrade notes: mark every column that clients sort on with "sortable": true in the query definition; a request
that sorts on any other column now fails with 400. Callers that sent systemFilters in the request body must set
them on the server instead, in an interceptor or before calling SearchService. The JGen mybatisQuery template and
the chenile-samples query services are updated to match.
Region-to-trajectory mapping works
RegionToTrajectoryConverter (utils) wrote the region into a header named chenile-trajectory-id, which nothing
reads, and read the region from x-region. It now reads the standard region header, x-chenile-region-id, and, when
the request has no trajectory, sets x-chenile-trajectory-id on the exchange and the trajectory in the request
context, so the service-reference step, cconfig and workflow resolvers all see it. Register it as a pre-processor:
chenile.pre.processors=regionToTrajectoryConverter. Its constructor now takes the ContextContainer.
Upgrade note: send the region as x-chenile-region-id instead of x-region.
Integration-test steps match the unit-test steps
chenile-bdd’s it-cucumber-utils now implements the whole REST step vocabulary of cucumber-utils against a
running server, so a feature file runs unchanged in both. Headers carry substituted ${variables}; every assertion
reads the REST Assured response (about ten used to fail with a ClassCastException); the warning steps that check a
code work; store … from response to … takes one space, as in unit tests (the two-space form stays as an alias); and
the collection, the value of …, size, empty-payload and fix and store JSON string steps are added. In both
it-cucumber-utils and chenile-core’s cucumber-utils, CukesContext now gives every thread its own map
(it used to give one only to the first thread). A new test runs each step against a local HTTP server and checks that every step
expression compiles and matches its method. See Cucumber step libraries.
Spring AI 2.0.1
chenile-parent moves from Spring AI 2.0.0-M2 to 2.0.1 (Jackson 3, MCP Java SDK 2.0.0). chenile-mcp now uses
org.springframework.ai.mcp.server.webmvc.transport.WebMvcStreamableServerTransportProvider and the Jackson 3
JacksonMcpJsonMapper. MCP request header names now arrive in lower case.
Upgrade notes: replace @ChenileMCP(name = ..., description = ...) with @ChenileMCP plus
@ChenileOperation(contractName = ..., description = ...); import the polymorph types from
org.chenile.core.polymorph; build variant names with variantName(...).