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

Support application/x-www-form-urlencoded post body (form data) #14

Open
fbjorn opened this issue Sep 18, 2023 · 0 comments
Open

Support application/x-www-form-urlencoded post body (form data) #14

fbjorn opened this issue Sep 18, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@fbjorn
Copy link
Collaborator

fbjorn commented Sep 18, 2023

Currently the library is built for JSON APIs. It can't handle other types of data, for example application/x-www-form-urlencoded.

We need to consider adding support of it.

Example of the spec:

export interface paths {
  "/token": {
    /**
     * Login 
     * @description Login endpoint.
     */
    post: operations["login_token_post"];
  };
  // ...
}

export interface operations {
  login_token_post: {
    requestBody: {
      content: {
        "application/x-www-form-urlencoded": components["schemas"]["Body_login_token_post"];
      };
    };
    responses: {
      /** @description Successful Response */
      200: {
        content: {
          "application/json": {
            [key: string]: string | undefined;
          };
        };
      };
      /** @description Validation Error */
      422: {
        content: {
          "application/json": components["schemas"]["HTTPValidationError"];
        };
      };
    };
  };
  // ...
}

export interface components {
  schemas: {
    /** Body_login_token_post */
    Body_login_token_post: {
      /** Grant Type */
      grant_type?: string | null;
      /** Username */
      username: string;
      /** Password */
      password: string;
      /**
       * Scope 
       * @default
       */
      scope?: string;
      /** Client Id */
      client_id?: string | null;
      /** Client Secret */
      client_secret?: string | null;
    };
    // ...
  }
}   
@fbjorn fbjorn added the enhancement New feature or request label Sep 18, 2023
@lietu lietu changed the title Support sending form data Support application/x-www-form-urlencoded post body (form data) Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant