HTTP QUERY·RFC 10008

OpenAPI 3.2 QUERY
Client Generator

Generate typed clients that send HTTP QUERY with a request body. Try a product search defined with a native query: operation or compare the output for eight client targets.

OpenAPI 3.2 JSON and YAML·Typed request bodies
catalog.yaml (excerpt)Input
openapi: 3.2.0
info: { title: Product Catalog, version: 1.0.0 }
servers:
  - url: https://catalog.example.com
paths:
  /products:
    query:
      operationId: searchProducts
      tags: [catalog]
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/ProductFilter' }
      responses:
        '200':
          description: Matching products
          content:
            application/json:
              schema: { type: array, items: { $ref: '#/components/schemas/Product' } }
compile
catalog.service.ts (excerpt)Output
  public searchProducts(body: ProductFilter): Observable<Array<Product>> {
    return this.execute<Array<Product>>('/products', body, { method: 'QUERY' });
  }
Request schema

A typed filter for the JSON body

The catalog API requires a term and accepts an optional maxPrice. The Fetch generator emits this TypeScript model and takes it as the body of searchProducts.

export interface ProductFilter {
  term: string;
  maxPrice?: number;
}
Mixed-method API

One path with QUERY, GET, and POST

Each operation in the catalog fixture keeps its declared HTTP method and body contract.

01ProofQUERY searches with a bodySpec · InCode · Out
catalog.yaml · QUERY
    query:
      operationId: searchProducts
      tags: [catalog]
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/ProductFilter' }
      responses:
        '200':
          description: Matching products
          content:
            application/json:
              schema: { type: array, items: { $ref: '#/components/schemas/Product' } }
catalog.service.ts · Fetch
export async function searchProducts(apiClient: ApiClient, body: ProductFilter): Promise<Array<Product>> {
    return apiClient.request<Array<Product>>({
      method: 'QUERY',
      url: '/products',
      body: body
    });
}
Hosted generator output

Compare the generated clients

The service sends QUERY with a typed body. The signal resource sends the same method when its filter signal has a value.

catalog.service.ts generated
import { BASE_URL } from '../injection-token';
import { Injectable, Signal } from '@angular/core';
import { Observable } from 'rxjs';
import { Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpResourceRef } from '@angular/common/http';
import { BaseApiService } from './base-api.service';
import { ProductFilter } from '../models/product-filter';
import { Product } from '../models/product';
import { NewProduct } from '../models/new-product';

@Injectable()
export class CatalogService extends BaseApiService {

  constructor(
    protected override readonly http: HttpClient,
    @Inject(BASE_URL) baseUrl: string
  ) {
    super(http, baseUrl);
  }

  public searchProducts(body: ProductFilter): Observable<Array<Product>> {
    return this.execute<Array<Product>>('/products', body, { method: 'QUERY' });
  }

  public listProducts(): Observable<Array<Product>> {
    return this.execute<Array<Product>>('/products', undefined, { method: 'get' });
  }

  public createProduct(body: NewProduct): Observable<Product> {
    return this.execute<Product>('/products', body);
  }

  public searchProductsResource(body: Signal<ProductFilter | undefined>): HttpResourceRef<Array<Product>> {
    return this.buildResource<Array<Product>>(() => {
      const bodyValue = body();
      if (typeof bodyValue === 'undefined') {
        return undefined;
      }
      return {
        url: this.buildUrl(`/products`),
        method: 'QUERY',
        body: bodyValue,
      };
      },
      { defaultValue: [] });
  }

  public listProductsResource(): HttpResourceRef<Array<Product>> {
    return this.buildResource<Array<Product>>(() => {
      return this.buildUrl(`/products`);
      },
      { defaultValue: [] });
  }
}
QUERY FAQ

Using the HTTP QUERY method

The sample uses a catalog search with a required JSON filter.

RFC 10008 defines HTTP QUERY as a safe, idempotent method that asks a resource to process a request body. A catalog search can send structured filters in JSON and return matching products without requesting a state change.
More converters

Same engine, other stacks.

Every converter runs the same spec-to-IR pipeline. Pick another source format or target stack.

OpenAPITypeScript
Angular httpResource, React TanStack Query, or framework-agnostic fetch.
Open converter
OpenAPIAngular
Typed services with httpResource, Signals, inject() DI, and interceptors.
Open converter
OpenAPIReact
TanStack Query hooks with stable query keys, or plain async functions.
Open converter
OpenAPIFetch
Framework-agnostic fetch client with ApiResult, middleware, and retries.
Open converter
OpenAPIJava Spring
RestClient services, Java records, sealed interfaces, Spring Boot 3.
Open converter
OpenAPIPython
Async httpx clients paired with Pydantic v2 models.
Open converter
OpenAPIGo
Idiomatic net/http client, context-aware, pointer-nullable fields.
Open converter
OpenAPIKotlin
Ktor client, kotlinx.serialization, sealed interfaces for oneOf.
Open converter
OpenAPIC#
Records, nullable reference types, JsonPolymorphic, HttpClient.
Open converter
OpenAPIRust
reqwest client with serde-tagged enums for oneOf and Option<T>.
Open converter
GraphQLAngular
Observable services with typed queries, mutations, and graphql-ws subscriptions.
Open converter
GraphQLReact
TanStack Query hooks with discriminated-union types and query keys.
Open converter
GraphQLKotlin
Ktor, kotlinx.serialization, Flow-based subscriptions.
Open converter
GraphQLC#
Records, nullable types, [JsonPolymorphic] unions, IAsyncEnumerable subscriptions.
Open converter
ProtobufKotlin
Ktor, coroutines, and sealed classes straight from .proto.
Open converter
ProtobufC#
Records, nullable types, Connect RPC over HttpClient.
Open converter
ProtobufGo
Plain structs with json tags, pointer presence, stdlib-only Connect client.
Open converter
SQLTypeScript
Postgres DDL to typed interfaces with foreign-key navigation.
Open converter
SQLKotlin
CREATE TABLE scripts to Kotlin @Serializable data classes.
Open converter

Generate a client from your OpenAPI spec

The converter UI runs in your browser. When you generate, your specification (or its URL), selected options, and any custom content you explicitly include are sent over HTTPS to the MetaEngine API. The API processes the payload ephemerally; specifications and generated code are not persisted or logged.

Read the public privacy policy Open the converter