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

OpenAPI importer ignoring secondary $ref elements in response examples #5367

Open
aweaver89 opened this issue Dec 9, 2024 · 0 comments
Open
Labels
bug Issues reporting bugs. product/docs Fern Docs which builds and hosts a developer documentation site

Comments

@aweaver89
Copy link
Contributor

aweaver89 commented Dec 9, 2024

CLI Version (from fern.config.json)

0.45.3

Minimal API Specification

{
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "swagger": "2.0",
  "info": {
    "description": "The following describe Paradex API. Bear in mind that this is still a work in\nprogress so all feedback is welcome.\n",
    "title": "Paradex REST API",
    "contact": {},
    "version": "1.83.4"
  },
  "host": "api.testnet.paradex.trade",
  "basePath": "/v1",
  "paths": {
    "/markets": {
      "get": {
        "description": "Get markets static data component\n",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Markets"
        ],
        "summary": "List available markets",
        "operationId": "get-markets",
        "parameters": [
          {
            "type": "string",
            "description": "Market Name - example: BTC-USD-PERP",
            "name": "market",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/responses.GetMarkets"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "responses.GetMarkets": {
      "type": "object",
      "properties": {
        "results": {
          "description": "List of available active markets",
          "type": "array",
          "items": {
            "$ref": "#/definitions/responses.MarketResp"
          }
        }
      }
    },
    "responses.MarketResp": {
      "type": "object",
      "properties": {
        "asset_kind": {
          "description": "Type of asset",
          "type": "string",
          "example": "PERP"
        },
        "base_currency": {
          "description": "Base currency of the market pair",
          "type": "string",
          "example": "ETH"
        },
        "option_cross_margin_params": {
          "description": "Option Cross margin parameters",
          "allOf": [
            {
              "$ref": "#/definitions/responses.PerpetualOptionCrossMarginParams"
            }
          ]
        }
      }
    },
    "responses.PerpetualOptionCrossMarginParams": {
      "type": "object",
      "properties": {
        "imf": {
          "$ref": "#/definitions/responses.PerpetualOptionMarginParams"
        },
        "mmf": {
          "$ref": "#/definitions/responses.PerpetualOptionMarginParams"
        }
      }
    },
    "responses.PerpetualOptionMarginParams": {
      "type": "object",
      "properties": {
        "long_itm": {
          "description": "Margin fraction for long ITM options",
          "type": "string",
          "example": "0.2"
        },
        "premium_multiplier": {
          "description": "Multiplier for margin fraction for premium",
          "type": "string",
          "example": "1.2"
        },
        "short_itm": {
          "description": "Margin fraction for short ITM options",
          "type": "string",
          "example": "0.4"
        },
        "short_otm": {
          "description": "Margin fraction for short OTM options",
          "type": "string",
          "example": "0.25"
        },
        "short_put_cap": {
          "description": "Cap for margin fraction for short put options",
          "type": "string",
          "example": "0.5"
        }
      }
    }
  }
}

Actual UI Behavior

The option_cross_margin_params property is shows correctly in the properties of the response. However it is skipped in the rendered response example to the right-hand side.

image

Expected UI Behavior

This show in the properties, so I would expect the example to contain this property. I think this might be related or a duplicate of this issue. In any case, I did validate the spec with openAPI tooling and this shows properly.

Steps to Reproduce

  1. Use a spec like the one provided
  2. If you remove the $ref elements from imf/mmf and input strings the render works
  3. Adding the $ref elements back you will no longer see the response example

Environment Details

No response

@aweaver89 aweaver89 added bug Issues reporting bugs. product/docs Fern Docs which builds and hosts a developer documentation site labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues reporting bugs. product/docs Fern Docs which builds and hosts a developer documentation site
Development

No branches or pull requests

1 participant