Skip to content

[BUG]: TypeSpec patch operations show warning #1172

@garrytrinder

Description

@garrytrinder

Description

There is a breaking change in v1.0.0 release for describing patch operations. When generating a TypeSpec file from API requests using the TypeSpecGeneratorPlugin, the PATCH operations generated display a warning and require an update.

Expected behaviour

Generated TypeSpec file should be valid with no warnings.

Actual behaviour

Image

Steps to reproduce

  1. Start Dev Proxy with configuration and start recording
  2. Issue PATCH request, for example...
PATCH https://jsonplaceholder.typicode.com/posts/1
Content-Type: application/json

{
  "title": "foo"
}
  1. Stop Dev Proxy
  2. Inspect generated TypeSpec file

Dev Proxy Version

v0.27.0

Operating system (environment)

macOS

Shell

zsh

Configuration file

{
	"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/rc.schema.json",
	"plugins": [
		{
			"name": "TypeSpecGeneratorPlugin",
			"enabled": true,
			"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
			"configSection": "typeSpecGeneratorPlugin"
		}
	],
	"typeSpecGeneratorPlugin": {
		"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/typespecgeneratorplugin.schema.json",
		"ignoreResponseTypes": false
	},
	"urlsToWatch": [
		"https://jsonplaceholder.typicode.com/*"
	],
	"logLevel": "information",
	"newVersionNotification": "stable",
	"showSkipMessages": true
}

Additional Info

TypeSpec 1.0 Release: https://typespec.io/docs/release-notes/release-2025-05-06/

To use JSON Merge-Patch to update resources, replace the body property with an instance of MergePatchUpdate as follows:

op patchPost(@path postId: integer, @body post: MergePatchUpdate<Post>): PostResponse;

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions