Adds v2.3.2 schemas#1625
Conversation
There was a problem hiding this comment.
Pull request overview
Adds JSON Schema definitions for Dev Proxy v2.3.2 configuration files and plugin-specific config files, enabling schema-based validation and editor tooling for that version.
Changes:
- Introduces a new
schemas/v2.3.2/schema set for corercconfig and multiple plugins. - Adds schemas for plugin auxiliary files (e.g., mocks files, rewrite rules, custom responses, prices files).
- Aligns the v2.3.2 schema inventory with the plugin surface area for that release.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/v2.3.2/typespecgeneratorplugin.schema.json | Adds schema for TypeSpec generator plugin configuration. |
| schemas/v2.3.2/rewriteplugin.schema.json | Adds schema for RewritePlugin configuration (rewrites file path). |
| schemas/v2.3.2/rewriteplugin.rewritesfile.schema.json | Adds schema for the RewritePlugin rewrite rules file. |
| schemas/v2.3.2/rc.schema.json | Adds schema for the main Dev Proxy config file (devproxyrc.json). |
| schemas/v2.3.2/ratelimitingplugin.schema.json | Adds schema for RateLimitingPlugin configuration. |
| schemas/v2.3.2/ratelimitingplugin.customresponsefile.schema.json | Adds schema for RateLimitingPlugin custom response file. |
| schemas/v2.3.2/openapispecgeneratorplugin.schema.json | Adds schema for OpenAPI spec generator plugin configuration. |
| schemas/v2.3.2/openaitelemetryplugin.schema.json | Adds schema for OpenAI Telemetry plugin configuration. |
| schemas/v2.3.2/openaitelemetryplugin.pricesfile.schema.json | Adds schema for OpenAI Telemetry plugin prices file. |
| schemas/v2.3.2/mockstdioresponseplugin.schema.json | Adds schema for MockStdioResponsePlugin configuration. |
| schemas/v2.3.2/mockstdioresponseplugin.mocksfile.schema.json | Adds schema for MockStdioResponsePlugin mocks file. |
| schemas/v2.3.2/mockresponseplugin.schema.json | Adds schema for MockResponsePlugin configuration. |
| schemas/v2.3.2/mockresponseplugin.mocksfile.schema.json | Adds schema for MockResponsePlugin mocks file. |
| schemas/v2.3.2/mockrequestplugin.schema.json | Adds schema for MockRequestPlugin configuration. |
| schemas/v2.3.2/mockrequestplugin.mockfile.schema.json | Adds schema for MockRequestPlugin mock request file. |
| schemas/v2.3.2/minimalpermissionsplugin.schema.json | Adds schema for MinimalPermissionsPlugin configuration. |
| schemas/v2.3.2/minimalpermissionsguidanceplugin.schema.json | Adds schema for MinimalPermissionsGuidancePlugin configuration. |
| schemas/v2.3.2/minimalcsompermissionsplugin.schema.json | Adds schema for MinimalCsomPermissionsPlugin configuration. |
| schemas/v2.3.2/minimalcsompermissions.types.schema.json | Adds schema for the CSOM types/permissions definition file. |
| schemas/v2.3.2/latencyplugin.schema.json | Adds schema for LatencyPlugin configuration. |
| schemas/v2.3.2/languagemodelratelimitingplugin.schema.json | Adds schema for LanguageModelRateLimitingPlugin configuration. |
| schemas/v2.3.2/languagemodelratelimitingplugin.customresponsefile.schema.json | Adds schema for LanguageModelRateLimitingPlugin custom response file. |
| schemas/v2.3.2/languagemodelfailureplugin.schema.json | Adds schema for LanguageModelFailurePlugin configuration. |
| schemas/v2.3.2/httpfilegeneratorplugin.schema.json | Adds schema for HttpFileGeneratorPlugin configuration. |
| schemas/v2.3.2/hargeneratorplugin.schema.json | Adds schema for HarGeneratorPlugin configuration. |
| schemas/v2.3.2/graphrandomerrorplugin.schema.json | Adds schema for GraphRandomErrorPlugin configuration. |
| schemas/v2.3.2/graphminimalpermissionsplugin.schema.json | Adds schema for GraphMinimalPermissionsPlugin configuration. |
| schemas/v2.3.2/graphminimalpermissionsguidanceplugin.schema.json | Adds schema for GraphMinimalPermissionsGuidancePlugin configuration. |
| schemas/v2.3.2/genericrandomerrorplugin.schema.json | Adds schema for GenericRandomErrorPlugin configuration. |
| schemas/v2.3.2/genericrandomerrorplugin.errorsfile.schema.json | Adds schema for GenericRandomErrorPlugin errors file. |
| schemas/v2.3.2/executionsummaryplugin.schema.json | Adds schema for ExecutionSummaryPlugin configuration. |
| schemas/v2.3.2/devtoolsplugin.schema.json | Adds schema for DevToolsPlugin configuration. |
| schemas/v2.3.2/crudapiplugin.schema.json | Adds schema for CrudApiPlugin configuration. |
| schemas/v2.3.2/crudapiplugin.apifile.schema.json | Adds schema for the CrudApiPlugin API definition file. |
| schemas/v2.3.2/cachingguidanceplugin.schema.json | Adds schema for CachingGuidancePlugin configuration. |
| schemas/v2.3.2/authplugin.schema.json | Adds schema for AuthPlugin configuration. |
| schemas/v2.3.2/apicenterproductionversionplugin.schema.json | Adds schema for ApiCenterProductionVersionPlugin configuration. |
| schemas/v2.3.2/apicenteronboardingplugin.schema.json | Adds schema for ApiCenterOnboardingPlugin configuration. |
| schemas/v2.3.2/apicenterminimalpermissionsplugin.schema.json | Adds schema for ApiCenterMinimalPermissionsPlugin configuration. |
| "apiPort": { | ||
| "type": "number", | ||
| "minimum": 0, | ||
| "maximum": 65535, | ||
| "description": "Port for the Dev Proxy API server." |
There was a problem hiding this comment.
apiPort is defined as JSON Schema type number, which allows fractional values (e.g., 8000.5) even though Dev Proxy expects an integer port (see DevProxy/Proxy/ProxyConfiguration.cs where ApiPort is int). Use type: "integer" here (and keep the existing min/max) to prevent invalid configs passing schema validation.
| "ipAddress": { | ||
| "type": "string", | ||
| "format": "ipv4", | ||
| "description": "IP address for Dev Proxy to listen on." | ||
| }, |
There was a problem hiding this comment.
ipAddress is restricted to format: "ipv4", but the runtime uses IPAddress.Parse(...) and supports IPv6 addresses as well. Consider widening this schema (e.g., allow both ipv4/ipv6, or use an anyOf with patterns) so valid IPv6 configurations aren’t rejected by schema validation.
| "watchPids": { | ||
| "type": "array", | ||
| "description": "List of process IDs to watch for network traffic.", | ||
| "items": { | ||
| "type": "number" | ||
| } |
There was a problem hiding this comment.
watchPids items are typed as number, which would allow fractional PIDs. The runtime uses IEnumerable<int> for PIDs, so schema validation should require integers (and ideally minimum: 0).
| "description": "(Optional) A regular expression pattern to match against the stdin body (case-insensitive). You can specify bodyRegex, bodyFragment, or both; if both are specified, bodyRegex takes precedence. If neither is specified, the mock matches any stdin or is applied immediately on startup." | ||
| }, | ||
| "nth": { | ||
| "type": "integer", |
There was a problem hiding this comment.
nth can be 0/negative per the schema, but matching is 1-based in the implementation and nth <= 0 will never match. Add minimum: 1 here to prevent invalid configurations being accepted by schema validation.
| "type": "integer", | |
| "type": "integer", | |
| "minimum": 1, |
| "includeCosts": { | ||
| "type": "boolean", | ||
| "description": "Whether to calculate and include cost information in the spans. Requires prices data.", | ||
| "default": true | ||
| }, |
There was a problem hiding this comment.
Schema sets includeCosts default to true, but the runtime default is false (OpenAITelemetryPluginConfiguration.IncludeCosts has no initializer). This makes the schema misleading and may cause tooling to suggest a default that changes behavior. Update the schema default to false or remove the default to match runtime behavior.
| "port": { | ||
| "type": "number", | ||
| "minimum": 0, | ||
| "maximum": 65535, | ||
| "description": "Port for Dev Proxy to listen on." | ||
| }, |
There was a problem hiding this comment.
port is defined as JSON Schema type number, which allows non-integer ports. Dev Proxy treats Port as an int (see DevProxy/Proxy/ProxyConfiguration.cs). Change the schema type to integer to align validation with actual runtime behavior.
| "timeout": { | ||
| "type": "number", | ||
| "minimum": 1, | ||
| "description": "Timeout in seconds for requests passing through Dev Proxy." | ||
| } |
There was a problem hiding this comment.
timeout is typed as number even though it represents a duration in seconds and the runtime stores it as an integer count (TimeoutSeconds). Change this to type: "integer" to avoid accepting fractional seconds that won’t map cleanly to the runtime configuration.
| "type": "object", | ||
| "description": "Body of the request (object or string)." |
There was a problem hiding this comment.
request.body is constrained to type: "object", but the runtime model (DevProxy.Abstractions/Models/MockRequest.Body) is dynamic and can be a string/array/etc. The schema should reflect what the plugin actually supports (at least object | array | string).
| "type": "object", | |
| "description": "Body of the request (object or string)." | |
| "type": [ | |
| "object", | |
| "array", | |
| "string" | |
| ], | |
| "description": "Body of the request (object, array, or string)." |
| }, | ||
| "nth": { | ||
| "type": "integer", | ||
| "description": "(Optional) Match the nth occurrence of the request." |
There was a problem hiding this comment.
nth can be set to 0 or a negative number per this schema, but the runtime matching logic treats the first occurrence as 1 and will never match nth <= 0. Add minimum: 1 (and consider documenting that it’s 1-based) to prevent configs that can never match.
| "description": "(Optional) Match the nth occurrence of the request." | |
| "minimum": 1, | |
| "description": "(Optional) Match the nth occurrence of the request. This value is 1-based." |
No description provided.