@@ -655,10 +655,32 @@ registry.registerPath({
655655 path : "/api/markets" ,
656656 operationId : "listMarkets" ,
657657 tags : [ "Markets" ] ,
658- summary : "List all markets" ,
658+ summary : "List all markets with cursor pagination" ,
659+ description :
660+ "Returns a cursor-paginated list of markets. Supports strong ETag / conditional GET: " +
661+ "send the ETag back as If-None-Match on subsequent requests; if the page is unchanged " +
662+ "the server responds 304 Not Modified (no body)." ,
663+ request : {
664+ headers : z . object ( {
665+ "if-none-match" : z . string ( ) . optional ( ) . openapi ( {
666+ description : "ETag from a previous 200 response. Triggers 304 when the page is unchanged." ,
667+ param : { name : "If-None-Match" , in : "header" } ,
668+ } ) ,
669+ } ) ,
670+ } ,
659671 responses : {
660672 200 : {
661673 description : "Array of markets" ,
674+ headers : {
675+ ETag : {
676+ description : "Strong ETag (SHA-256) of the response body." ,
677+ schema : { type : "string" } ,
678+ } ,
679+ "Cache-Control" : {
680+ description : "Always no-cache so clients revalidate before reuse." ,
681+ schema : { type : "string" , example : "no-cache" } ,
682+ } ,
683+ } ,
662684 content : {
663685 "application/json" : {
664686 schema : z . object ( { data : z . array ( Market ) } ) ,
@@ -695,6 +717,13 @@ registry.registerPath({
695717 } ,
696718 } ,
697719 } ,
720+ 304 : {
721+ description : "Not Modified — page unchanged since the ETag in If-None-Match." ,
722+ } ,
723+ 400 : {
724+ description : "Invalid query parameters" ,
725+ content : { "application/json" : { schema : ErrorBody } } ,
726+ } ,
698727 } ,
699728} ) ;
700729
@@ -704,17 +733,36 @@ registry.registerPath({
704733 operationId : "searchMarkets" ,
705734 tags : [ "Markets" ] ,
706735 summary : "Full-text search across markets" ,
736+ description :
737+ "Full-text search with fuzzy trigram fallback. Supports strong ETag / conditional GET: " +
738+ "send the ETag back as If-None-Match; if results are unchanged the server responds 304 Not Modified." ,
707739 request : {
708740 query : z . object ( {
709741 q : z . string ( ) . min ( 1 ) ,
710742 limit : z . coerce . number ( ) . int ( ) . positive ( ) . default ( 20 ) . optional ( ) ,
711743 offset : z . coerce . number ( ) . int ( ) . nonnegative ( ) . default ( 0 ) . optional ( ) ,
712744 page : z . coerce . number ( ) . int ( ) . positive ( ) . optional ( ) ,
713745 } ) ,
746+ headers : z . object ( {
747+ "if-none-match" : z . string ( ) . optional ( ) . openapi ( {
748+ description : "ETag from a previous 200 response. Triggers 304 when results are unchanged." ,
749+ param : { name : "If-None-Match" , in : "header" } ,
750+ } ) ,
751+ } ) ,
714752 } ,
715753 responses : {
716754 200 : {
717755 description : "Search results" ,
756+ headers : {
757+ ETag : {
758+ description : "Strong ETag (SHA-256) of the response body." ,
759+ schema : { type : "string" } ,
760+ } ,
761+ "Cache-Control" : {
762+ description : "Always no-cache so clients revalidate before reuse." ,
763+ schema : { type : "string" , example : "no-cache" } ,
764+ } ,
765+ } ,
718766 content : {
719767 "application/json" : {
720768 schema : MarketSearchResult ,
@@ -759,6 +807,9 @@ registry.registerPath({
759807 } ,
760808 } ,
761809 } ,
810+ 304 : {
811+ description : "Not Modified — search results unchanged since the ETag in If-None-Match." ,
812+ } ,
762813 400 : {
763814 description : "Missing query parameter" ,
764815 content : {
@@ -822,10 +873,31 @@ registry.registerPath({
822873 operationId : "getMarketById" ,
823874 tags : [ "Markets" ] ,
824875 summary : "Get a market by ID" ,
825- request : { params : z . object ( { id : z . string ( ) } ) } ,
876+ description :
877+ "Returns a single market by ID. Supports strong ETag / conditional GET: " +
878+ "send the ETag back as If-None-Match; if unchanged the server responds 304 Not Modified." ,
879+ request : {
880+ params : z . object ( { id : z . string ( ) } ) ,
881+ headers : z . object ( {
882+ "if-none-match" : z . string ( ) . optional ( ) . openapi ( {
883+ description : "ETag from a previous 200 response. Triggers 304 when the market is unchanged." ,
884+ param : { name : "If-None-Match" , in : "header" } ,
885+ } ) ,
886+ } ) ,
887+ } ,
826888 responses : {
827889 200 : {
828890 description : "Market" ,
891+ headers : {
892+ ETag : {
893+ description : "Strong ETag (SHA-256) of the response body." ,
894+ schema : { type : "string" } ,
895+ } ,
896+ "Cache-Control" : {
897+ description : "Always no-cache so clients revalidate before reuse." ,
898+ schema : { type : "string" , example : "no-cache" } ,
899+ } ,
900+ } ,
829901 content : {
830902 "application/json" : {
831903 schema : z . object ( { data : Market } ) ,
@@ -854,6 +926,14 @@ registry.registerPath({
854926 content : { "application/json" : { schema : ErrorBody } } ,
855927 } ,
856928 } ,
929+ 304 : {
930+ description : "Not Modified — market unchanged since the ETag in If-None-Match." ,
931+ } ,
932+ 404 : {
933+ description : "Not found" ,
934+ content : { "application/json" : { schema : ErrorBody } } ,
935+ } ,
936+ } ,
857937} ) ;
858938
859939const PatchMarketRequest = z
0 commit comments