Repository navigation
fix(mdl): document import/export mappings, published REST services and data transformers (mendixlabs/mxcli#1510) - #1533
Merged
ako merged 2 commits intoOct 21, 2026
Conversation
… transformers (mendixlabs#1510) lint QUAL002 asks for documentation on import and export mappings, published REST services and data transformers, and MDL could not write it: the four create statements had no Documentation field, so the `/** ... */` doc comment above them was dropped with MDL089 and the findings were permanent. Two more defects kept them that way: - every create or modify wrote an empty Documentation over the stored text (the executors never set it; the data transformer writer wrote a literal ""), so describe -> exec of a Studio Pro-documented mapping or transformer deleted its documentation; - the catalog wrote "" for published_rest_services.Documentation, so QUAL002 reported every published REST service, documented or not. The doc comment is now each statement's documentation, as on a JSON structure: the visitor reads it with its presence bit, the executors set it and carry the stored text when no comment is written (#1018), the modelsdk backend reads and writes the top-level `Documentation` key for published REST services and data transformers (verified against modelsdk/gen and against Mendix's own reader with `mx dump-mpr` on 11.6.6 and 11.15), describe prints it back, and the catalog stores it. PublicDocumentation (the OpenAPI text) keeps being carried as stored. Java action parameter descriptions were already writable (mendixlabs#1588); the bug-test script covers them alongside. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3x8Fyvir8kLyPgJs1BDmF
… create (mendixlabs#1510) A doc comment above a create that stores no documentation was warned with "Move the doc comment directly above `create json structure ...`, after the `create or modify published rest service ...`" -- moving text written for one element onto a different one. The next-statement suggestion is right when a drop, grant, revoke, set or alter stands between a comment and its create (#877), but a create is itself the element the comment describes. For a create, MDL089 now says MDL cannot store documentation for that element and suggests a `--` comment; the move suggestion stays for the other statements. The check-syntax skill says the same (and no longer lists `create module`, which stores documentation since #1314). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3x8Fyvir8kLyPgJs1BDmF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes mendixlabs#1510 (#1392). The maintainer chose option (a): let MDL write the documentation that QUAL002 asks for. Two commits.
Syntax
No new keywords. The existing
/** … */doc comment above a create is now stored, as it already is for JSON structures:create or modify, leaving out the comment keeps the stored text, and an empty/** */clears it (the same rule as MDL-BUTTON02: also flag own-container names in data sources and widget expressions #1018).*/is printed as--lines, so running the output keeps the stored text./** desc */ Param: Type) were already added on main bycreate java actioncannot set parameter descriptions or the return value name; the-- …form thatdescribeprints is silently dropped mendixlabs/mxcli#1588. They are verified end to end here and covered by the bug-test script.Root causes (commit 1)
Documentationfield, so the comment was classed as detached (MDL089) and never read.create or modifywrote an empty value over it. The data transformer writer wrote a hard-coded"". A PedApp test proves that describe → exec of a Studio Pro-documented mapping deleted its documentation.""forpublished_rest_services.Documentation, so QUAL002 flagged every service, even ones documented in Studio Pro.Fix:
model.PublishedRestServiceandmodel.DataTransformergainDocumentation, read and written by the backend.Documentationis no longer in the published REST service's unauthored set.PublicDocumentation(the OpenAPI text) is still carried as stored.BSON field verified: a top-level
Documentationstring onImportMappings$ImportMapping,ExportMappings$ExportMapping,Rest$PublishedRestServiceandDataTransformers$DataTransformer. The evidence:mx dump-mprshowing each MDL-written comment as that unit'sdocumentation, on 11.6.6 and 11.15.Commit 2: MDL089 message
For a doc comment above a create that can't store one, MDL089 used to say "move it above the next create". That would attach the comment to a different element. It now says MDL can't store documentation for that element and suggests a
--comment. Drop, grant, revoke, set and alter keep the old suggestion.Measured
Lint control: undocumented copies of the same elements still give 4 QUAL002 findings.
Tests
TestIntegrationDocumentsReadDocComment_Issue1510(visitor).TestIntegrationDocumentation_Issue1510(PedApp copy): stored key, describe → exec round trip, carry, and/** */clearing.TestIntegrationDocumentation_StudioProMappingKeepsIt_Issue1510.TestPublishedRestServiceDocumentationReachesCatalog_Issue1510, with an undocumented service as control.TestDocumentation_SurvivesRewritegets four new cases (-tags integration, against an mx 11.15 project).TestValidateProgram_DetachedDocCommentOnCreate_Issue1510.Revert check:
Also in this PR: syntax help (import mapping, export mapping, data transformer, published REST), docs-site reference pages, the json-structures-and-mappings skill, two finding files, and
mdl-examples/bug-tests/1510-documentation-for-mappings-rest-javaparams.mdl.make build,make test,make lint,check-findings,check-skill-indexandcheck-skill-mdlpass.For review
create or modifyof a published REST service with a doc comment now overwrites the stored documentation. Before, the stored text was always kept.--fallback for text containing*/has no test.Generated by Claude Code