Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: release package #36

Merged
merged 1 commit into from
Feb 15, 2024
Merged

ci: release package #36

merged 1 commit into from
Feb 15, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 21, 2023

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

openapi-msw@0.3.0

Minor Changes

  • #33 1f3958d Thanks @christoph-fricke! - Added query helper to resolver-info argument. It provides a type-safe wrapper around URLSearchParams for reading search parameters. As usual, the information about available parameters is inferred from your OpenAPI spec.

    /*
    Imagine this endpoint specification for the following example:
    
    /query-example:
      get:
        summary: Query Example
        operationId: getQueryExample
        parameters:
          - name: filter
            in: query
            required: true
            schema:
              type: string
          - name: page
            in: query
            schema:
              type: number
          - name: sort
            in: query
            required: false
            schema:
              type: string
              enum: ["asc", "desc"]
          - name: sortBy
            in: query
            schema:
              type: array
              items:
                type: string
    */
    
    const handler = http.get("/query-example", ({ query }) => {
      const filter = query.get("filter"); // Typed as string
      const page = query.get("page"); // Typed as string | null since it is not required
      const sort = query.get("sort"); // Typed as "asc" | "desc" | null
      const sortBy = query.getAll("sortBy"); // Typed as string[]
    
      // Supported methods from URLSearchParams: get(), getAll(), has(), size
      if (query.has("sort", "asc")) {
        /* ... */
      }
    
      return HttpResponse.json({
        /* ... */
      });
    });
  • #35 07fa9b0 Thanks @christoph-fricke! - Restructured the library to add support for additional response resolver info. The enhanced ResponseResolver type and ResponseResolverInfo are available as exports.

@christoph-fricke christoph-fricke merged commit b272a84 into main Feb 15, 2024
@christoph-fricke christoph-fricke deleted the changeset-release/main branch February 15, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant