-- schema.json --
{
	"oneOf": [
		{
			"type": "object"
		},
		{
			"maxLength": 3,
			"type": "string"
		}
	],
	"patternProperties": {
		"^x-": {
			"type": "string"
		}
	}
}
-- out/decode/extract --
import "strings"

matchN(1, [{
	...
}, strings.MaxRunes(
	3)]) & (string | {
	{[=~"^x-"]: string}
	...
})
