OpenAPI import: send header parameters, read path-item parameters - #883
Merged
Merged
Conversation
Reported in #868: the schema the model saw and the request the engine sent disagreed in two places. - Header parameters went into the tool's input schema (even as required) but never into endpointMapping.headers, so the value was dropped. They are now mapped as `$name`, which the REST engine already resolves and leaves out when the argument is not given. - Parameters declared on the path item (next to get/post) were ignored, so `/users/{userId}` had no input for userId and the literal `{userId}` went out in the URL. They are now merged into every operation, the operation's own entry winning on the same name + in. Closes #868
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #868 (thanks for the precise report).
required) but never inendpointMapping.headers, so the value the model supplied was dropped. Now mapped as$name;RestEnginealready resolves$paramheaders and omits the header when the argument is absent, so a connector-level header of the same name still applies.get/post) were ignored:/users/{userId}produced a tool withoutuserIdand the literal{userId}in the URL. They are merged into every operation under the path; the operation's own entry wins on the samename+in.Existing connectors keep their tools until they are re-imported or re-synced.
Tests: 3 new/extended cases in
openapi.parser.spec.ts(header mapping asserted onendpointMapping, the reporter's two specs). Backend suite green.