Importing API from swagger file in API Management giving error- Unable to parse specified file. Please ensure it is a valid OpenAPI Specification document.

Nitya Singh (INDIA - BAS) 25 Reputation points
2023-05-16T05:47:27.52+00:00

Following is the content of swagger file-

openapi: 3.0.0
info:
  title: Login Journey API
  description: |
    This API contains operations related to login journey
  termsOfService: http://swagger.io/terms/
  contact:
    email: ******@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0

paths:
  /doLogin:
    post:
      tags:
      - customerLogin
      summary: customerLogin
      operationId: custloginbyusridpwd
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/doLogin_body'
      responses:
        "200":
          description: Login Successful
        "405":
          description: Invalid credentials
    /GenerateOTP:
    post:
      tags:
      - OTPGeneration
      summary: OTPGeneration
      operationId: generateotp
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateOTP_body'
      responses:
        "200":
          description: OTP is generated successfully
        "405":
          description: Invalid input
components:
  schemas:
  doLogin_body:
      type: object
      properties:
        userNme:
          type: string
          description: encrypted userName
        password:
          type: string
          description: encrypted password
    GenerateOTP_body:
      type: object
      properties:
        UniqueReferenceNumber:
          type: number
          description: unique transaction reference number generated for tracking          
        MobileNumber:
          type: string
          description: mobile number for which OTP is generated and shared with
Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2023-05-16T09:26:10.65+00:00

    @Nitya Singh (INDIA - BAS) Thanks for reaching out. Please leverage the https://editor.swagger.io/ to validate your swagger content as it looks invalid for the line no 32. There are few API import restrictions and known issues while importing the API please refer to this document.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.