@@ -69,14 +69,6 @@ const QueryParameterSchemas: Record<string, OpenApiSchema> = {
6969 "GET /api/session/{sessionID}/message limit" : { type : "number" } ,
7070}
7171
72- const PathParameterSchemas : Record < string , OpenApiSchema > = {
73- sessionID : { type : "string" , pattern : "^ses.*" } ,
74- messageID : { type : "string" , pattern : "^msg.*" } ,
75- partID : { type : "string" , pattern : "^prt.*" } ,
76- permissionID : { type : "string" , pattern : "^per.*" } ,
77- ptyID : { type : "string" , pattern : "^pty.*" } ,
78- }
79-
8072const LegacyComponentDescriptions : Record < string , string > = {
8173 LogLevel : "Log level" ,
8274 ServerConfig : "Server configuration for opencode serve and web commands" ,
@@ -486,7 +478,7 @@ function flattenOptions(options: OpenApiSchema[] | undefined): OpenApiSchema[] |
486478function normalizeParameter ( param : OpenApiParameter , route : string ) {
487479 if ( ! param . schema || typeof param . schema !== "object" ) return
488480 if ( param . in === "path" ) {
489- param . schema = pathParameterSchema ( route , param . name ) ?? stripOptionalNull ( param . schema )
481+ param . schema = stripOptionalNull ( param . schema )
490482 return
491483 }
492484 if ( param . in === "query" ) {
@@ -505,15 +497,6 @@ function normalizeParameter(param: OpenApiParameter, route: string) {
505497 param . schema = stripOptionalNull ( param . schema )
506498}
507499
508- function pathParameterSchema ( route : string , name : string ) {
509- if ( name in PathParameterSchemas ) return PathParameterSchemas [ name ]
510- if ( name === "id" && route . startsWith ( "DELETE /experimental/workspace/" ) ) return { type : "string" , pattern : "^wrk.*" }
511- if ( name === "id" && route . startsWith ( "POST /experimental/workspace/" ) ) return { type : "string" , pattern : "^wrk.*" }
512- if ( name === "requestID" && route . startsWith ( "POST /permission/" ) ) return { type : "string" , pattern : "^per.*" }
513- if ( name === "requestID" && route . startsWith ( "POST /question/" ) ) return { type : "string" , pattern : "^que.*" }
514- return undefined
515- }
516-
517500export const PublicApi = OpenCodeHttpApi . annotateMerge (
518501 OpenApi . annotations ( {
519502 title : "opencode" ,
0 commit comments