Skip to main content
Moderne OnlyThis recipe is proprietary to Moderne and runs on the Moderne platform or CLI — it isn’t part of the open-source catalog. Available with a Moderne subscription.Contact Sales

Find .NET endpoint contracts

Recipe IDio.moderne.prethink.calm.FindDotnetEndpointContracts
Artifactio.moderne.recipe:rewrite-prethink

Extract request body, response body (unwrapping ActionResult<T>/Task<T>), and per-parameter binding source ([FromBody/Query/Route/Header/Form]) for ASP.NET Core controller endpoints.

Single recipeOpenRewriteModerne Proprietary License
Try in PlatformTry this recipe in the Moderne platform. Not a user yet? You’ll get a no-setup demo environment, with nothing to install or configure.

Usage

Run this recipe

This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI.

You will need to have configured the Moderne CLI on your machine before you can run the following command.

shell
mod run . --recipe FindDotnetEndpointContracts

If the recipe is not available locally, then you can install it using:

mod config recipes jar install io.moderne.recipe:rewrite-prethink:0.8.1

Data tables

Endpoint request/response schemas
io.moderne.prethink.table.EndpointSchemas

Per-endpoint request body and response body bindings, one row per (endpoint, status code) pair. Supports OpenAPI 3.0.3 generation by giving the LLM a full mapping from handler to body DTO FQNs.

ColumnDescription
Endpoint IDJoin key matching the 'Entity ID' column of service-endpoints.csv.
Source pathThe path to the source file containing the handler.
Service classThe fully qualified name of the controller/resource class.
Method nameThe handler method name.
HTTP methodThe HTTP method (GET, POST, etc.).
PathThe full request path including class-level prefix.
Request body FQNFully qualified name of the request body DTO class, or null when the handler takes no body.
Request body resolutionHow the request body type was resolved: 'resolved' (FQN known), 'simple-name' (only the class simple name could be recovered), 'unresolved' (could not be determined), or 'none' (no request body).
Request body requiredWhether the request body is required (false only when @RequestBody(required=false)).
Response statusHTTP status code for this response row (e.g. 200, 201, 400).
Response body FQNFully qualified name of the response body DTO for this status, after unwrapping ResponseEntity/Mono/Optional/collection wrappers.
Response body resolutionHow the response body type was resolved: 'resolved' (FQN known), 'simple-name', 'unresolved', or 'none' (void return / no body).
Response is collectionTrue when the response body is a collection type (List/Set/Page/Slice/array).
Response sourceWhere this response row was derived: 'return-type', '@ResponseStatus', or '@ApiResponse'.
FrameworkThe framework hosting the endpoint (Spring, JAX-RS, Micronaut).
Endpoint parameters
io.moderne.prethink.table.EndpointParameters

Per-parameter detail for REST endpoint handlers - path, query, header, form. Join to service-endpoints.csv via endpointId.

ColumnDescription
Endpoint IDJoin key matching the 'Entity ID' column of service-endpoints.csv.
Parameter nameThe wire-level parameter name (from @PathVariable(name=...), @RequestParam(name=...), etc.).
Parameter kindWhere the parameter comes from: 'path', 'query', 'header', or 'form'.
Type FQNFully qualified name of the parameter's Java type.
Type resolutionHow the parameter type was resolved: 'resolved' (FQN known), 'simple-name', or 'unresolved'.
FormatOpenAPI 3.0.3 format (int32, int64, date-time, uuid, etc.) or null.
RequiredWhether the parameter is required.
Default valueDefault value if declared (e.g. @RequestParam(defaultValue = "0")), else null.
Java parameter nameThe original Java parameter name (may differ from wire name).
Source files that had results
org.openrewrite.table.SourcesFileResults

Source files that were modified by the recipe run.

ColumnDescription
Source path before the runThe source path of the file before the run. null when a source file was created during the run.
Source path after the runA recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run.
Parent of the recipe that made changesIn a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all.
Recipe that made changesThe specific recipe that made a change.
Estimated time savingAn estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds.
CycleThe recipe cycle in which the change was made.
Source files that had search results
org.openrewrite.table.SearchResults

Search results that were found during the recipe run.

ColumnDescription
Source path of search result before the runThe source path of the file with the search result markers present.
Source path of search result after run the runA recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run.
ResultThe trimmed printed tree of the LST element that the marker is attached to.
DescriptionThe content of the description of the marker.
Recipe that added the search markerThe specific recipe that added the Search marker.
Source files that errored on a recipe
org.openrewrite.table.SourcesFileErrors

The details of all errors produced by a recipe run.

ColumnDescription
Source pathThe file that failed to parse.
Recipe that made changesThe specific recipe that made a change.
Stack traceThe stack trace of the failure.
Recipe performance
org.openrewrite.table.RecipeRunStats

Statistics used in analyzing the performance of recipes.

ColumnDescription
The recipeThe recipe whose stats are being measured both individually and cumulatively.
Source file countThe number of source files the recipe ran over.
Source file changed countThe number of source files which were changed in the recipe run. Includes files created, deleted, and edited.
Cumulative scanning time (ns)The total time spent across the scanning phase of this recipe.
Max scanning time (ns)The max time scanning any one source file.
Cumulative edit time (ns)The total time spent across the editing phase of this recipe.
Max edit time (ns)The max time editing any one source file.