Apicurio / apicurio-studio

Open Source API Design
https://www.apicur.io/studio/
Apache License 2.0
956 stars 489 forks source link

Apicurio is not importing referenced header parameters and request body #1979

Open ukchaitanya opened 1 year ago

ukchaitanya commented 1 year ago

Hi Team, Trying to import OAS 3.0.1 using Apicurio and it's not importing any parameters and request body defined through references whereas the same is working using the swagger editor. Could you please check this and kindly let me know if this is a bug or the expected behavior from the Apicurio. Below is the OAS doc FYR:

openapi: 3.0.1
info:
  title: Item Recommendations Service
  description: Recommendations Service is a RESTful service that fetches localized and personalized recommendations.
  x-audience: component-internal
  x-api-id: item-recommendations
  contact:
    name: Item Recmnd Service API
    url: 'https://spr.stg.abc.com'
    email: item-rec@email.abc.com
  version: 1.0.0
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
servers:
  - description: SwaggerHub API Auto Mocking
    url: 'https://abc.xyz.com/unytr/vlm/1.0.0'
  - description: Generated server url for staging
    url: 'https://spr.stg.abc.com'
paths:
  /events/{recommender_id}:
    post:
      tags:
        - Real time Click Stream Event Ingestion
      summary: Add a new realtime click stream event
      operationId: createEvent
      parameters:
      - $ref: '#/components/parameters/recommenderId'
      - $ref: '#/components/parameters/correlationId'
      requestBody:
        $ref: '#/components/requestBodies/EventData'
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
components:
  parameters:
    recommenderId:
      name: recommender_id
      in: path
      description: recommendationId
      required: true
      schema:
        type: string
        enum:
        - rvi
    correlationId:
      name: correlation_id
      in: header
      description: >
            Unique & Random id per request ( Need to evaluate and change to
            trace id/ span id)
      required: true
      schema:
        type: string
  requestBodies:
    EventData:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EventData'
      description: Event object that needs to be added to the data store
      required: true
  schemas:
    EventData:
      type: object
      required:
        - session_id
        - event_id
        - event_type
      properties:
        event_id:
          type: string
          description: >
            unique id for an event. if more than one event sent with same event,
            then API will discard it. If not passed in API, backend will
            generate unique id.
          format: uuid
        session_id:
          description: |
            unique id for a given user session.
          type: string
          format: uuid
        event_type:
          type: string
          description: |
            Item id classification. it can be a product id or category id.
          enum:
            - view-product
            - view-category
EricWittmann commented 1 year ago

Apicurio Studio's openapi editor doesn't currently support editing of re-usable request bodies or parameters in the visual designer. You can still edit those entities using the source tab.