Repository navigation
Conversation
The OpenAPI importer wires every JSON response as raw `Response: json`; users and agents must hand-write the entities and mapping. Proposes an opt-in `GenerateEntities: Yes` that creates non-persistent entities and writes inline `Response: mapping` (Rest$ImplicitMappingResponseHandling, already supported), phased: P0 stops the silent Swagger 2.0 downgrade (measured: empty contract, no warning) and adds skill guidance; P1 schema model; P2 object-rooted generation; P3 array roots (needs a Studio Pro reference); P4 Swagger 2.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PnpNHdpFqu1sPL7yNAQgTh
… contract The parser reads only OpenAPI 3 fields, so a Swagger 2.0 spec (the reporter's petstore.swagger.io/v2) unmarshalled cleanly into an empty contract: BaseUrl '', request bodies dropped, every response `none`, no warning. It is now refused with a conversion hint. Also documents, in the rest-client skill and the docs-site, that the import returns JSON responses as strings and how to wire `Response: mapping` instead - the route the reporter's agent got wrong. Phase 0 of PROPOSAL_openapi_response_entities.md (#1234). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PnpNHdpFqu1sPL7yNAQgTh
…ntract-drift-9p6ini
…ntract-drift-9p6ini # Conflicts: # .claude/skills/mendix/rest-client/SKILL.md
TestSkillsTeachMDL1 requires every complete script in a skill to start with `mdl 1;`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PnpNHdpFqu1sPL7yNAQgTh
This branch has not been deployed
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.
Refs #1234 (mendixlabs#280). This PR does not close the issue: it carries the design and Phase 0 only.
1. Proposal:
docs/11-proposals/PROPOSAL_openapi_response_entities.md(draft)The OpenAPI import wires every JSON response as raw
Response: json. The proposal adds an opt-inGenerateEntities: Yesthat:Response: mapping. mxcli already writes this form (Rest$ImplicitMappingResponseHandling, round-tripped since A recursive microflow cannot be created in one statement (exec: microflow not found; check passes) #843), so no JSON-structure or import-mapping documents are needed.The work is phased. Array roots and nested arrays are blocked on a Studio Pro reference project; the proposal's open questions list what that project needs to show.
2. Phase 0 (this PR's code)
Symptom, measured on the reporter's spec (
petstore.swagger.io/v2/swagger.json, Swagger 2.0):describe contract operation from openapiand the create path reported success, but produced:BaseUrl: '';Response: noneon every operation;Cause:
openapi.ParseSpecunmarshals into OpenAPI 3 types only, and a 2.0 document parses cleanly into an empty contract.Fix:
swaggerfield is refused with a conversion hint (npx swagger2openapi/ converter.swagger.io). Full 2.0 support is Phase 4 of the proposal.rest-clientskill and the docs-site now say that the import returns JSON responses as strings, and show how to wireResponse: mapping Entity { … }. The reporter's agent wrote entities and import mappings, then left every operation atResponse: JSON.Evidence:
TestParseSpec_RefusesSwagger2(JSON and YAML). It failed before the fix (a Swagger 2.0 document was accepted (1 paths)).TestParseSpec_AcceptsOpenAPI3is the control: 3.0 and 3.1 still parse and convert.mdl-examples/bug-tests/280-openapi-swagger2-refused.mdlwith fixturemdl-examples/openapi-local-specs/petstore-swagger2.json. It is a plain.mdlbecausemxcli checkcannot see an execution-time refusal; the unit test pins the guard.make build,make lint,make test,make check-skill-mdl,make check-skill-indexandmake check-findingspass. Finding recorded.mainis merged in, re-checked after the merge.Generated by Claude Code