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

Feat: Support x-www-form-urlencoded request bodies #222

Merged
merged 2 commits into from
Jan 2, 2023

Conversation

jlalmes
Copy link
Owner

@jlalmes jlalmes commented Jan 2, 2023

Closes #187

Feat: Support application/x-www-form-urlencoded Content-Type.

Added contentTypes parameter to the OpenApiMeta for each procedure. (Defaults to ["application/json"]).

Examples

// support only `x-www-form-urlencoded`
.meta({
  openapi: {
    method: 'POST',
    path: '/echo',
    contentTypes: [
      'application/x-www-form-urlencoded'
    ],
  },
})

// support `application/json` and `x-www-form-urlencoded`
.meta({
  openapi: {
    method: 'POST',
    path: '/echo',
    contentTypes: [
      'application/json',
      'application/x-www-form-urlencoded'
    ],
  },
})

// defaults to `application/json`
.meta({
  openapi: {
    method: 'POST',
    path: '/echo',
  },
})

@jlalmes jlalmes merged commit 02b8f65 into master Jan 2, 2023
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.

Feat: Support application/x-www-form-urlencoded request bodies
1 participant