fix(openapi-converter): stop dropping tool inputs on non-JSON request bodies and content-form parameters
This covers the two gaps in _extract_inputs from the issue; the third gap (OAS2 response examples sibling map, in _extract_outputs) is a separate function and stays out of this PR.
Root cause 1: for the OAS3 requestBody, _extract_inputs read only content["application/json"], with no fallback to any other media type. _extract_outputs already falls back to the first schema-bearing media type for responses; _extract_inputs never got the same treatment. A body declared only under application/xml, text/plain, or a vendor +json subtype produced a tool with no body input field at all.
Root cause 2: an OAS3 Parameter Object may carry its schema under a content map (content: {<media-type>: {schema, example}}) instead of a top-level schema key, for parameters that need a non-default media type. _extract_inputs only read param["schema"], so a content-form parameter lost both its schema and its examples.
Fix: mirror _extract_outputs's existing media-type fallback in the request-body branch, and add a content-form branch for parameters that falls back to the first media type entry when schema is absent, feeding its schema and examples into the same _merge_examples path the rest of the function already uses.
Verified: added two regression tests (test_openapi_converter_request_body_falls_back_to_first_schema_bearing_media_type, test_openapi_converter_parameter_content_form_schema_and_examples); both fail on current main (missing/empty body/filter input) and pass on this branch, run in a clean python:3.11-slim and python:3.13-slim container (the matrix's low and high Python versions) alongside the plugin's full existing test suite (240 passed, unchanged). Coverage confirms every changed line is exercised by the new tests. Not verified: Windows/macOS (no runner available here); the CI matrix's --doctest-modules flag doesn't touch this file since no doctests were added.
Refs #98
Summary by cubic
Fixes the OpenAPI converter dropping tool inputs for non-JSON request bodies and content-form parameters, and now propagates the resolved body media type and honors requestBody.required.
Bug Fixes
- Request bodies fall back to the first schema-bearing media type when
application/jsonis absent, and that media type now reaches the call template so bodies aren't sent as JSON. - Parameters using the OAS3
contentmap now pick up the schema and examples from the first media type entry. - The
bodyinput is required wheneverrequestBody.requiredis true, not just when the schema lists required properties. - The third gap from #98 (OAS2 response
examplessibling map) stays for a separate PR. - Adds regression tests for the fixed behaviors.