swagger-api / swagger-api/swagger-ui

Is there any way to configure the content-type in auth

Open
#7,422 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: auth type: support
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: macOS
  • Browser: chrome
  • Version: Version 91.0.4472.114 (Official Build) (x86_64)
  • Method of installation: npm
  • Swagger-UI version: 3.51.1
  • Swagger/OpenAPI version: Swagger 2.0
Content & configuration

Swagger/OpenAPI definition:

  jwt:
    description: ''
    type: apiKey
    name: Authorization
    in: header
  roserocket_auth:
    type: oauth2
    tokenUrl: 'https://auth.roserocket.com/oauth2/token'
    flow: password

Swagger-UI configuration options:

import React from 'react';
import SwaggerUI from 'swagger-ui-react';
import 'swagger-ui-react/swagger-ui.css';
import swaggerFile from './swagger.yaml';

const ApiDocsSettings = () => <SwaggerUI spec={swaggerFile} />;

export default ApiDocsSettings;
How can we help?

Is there any way to specify the content-type for authentication? I see that when the request is sent it's set to application/x-www-form-urlencoded however I need it to be application/json. Unsure whether that's something that is configurable in the definition or through the UI.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Swagger/OpenAPI definition's OAuth2 password flow and the SwaggerUI React configuration shown in the issue, then trace how the authentication request is assembled. Determine whether the content type is configurable and define done as either identifying the supported configuration or documenting the required change for JSON requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.