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

[BUG]ref error after convertion #66

Open
shiningstarts opened this issue Dec 26, 2022 · 1 comment
Open

[BUG]ref error after convertion #66

shiningstarts opened this issue Dec 26, 2022 · 1 comment

Comments

@shiningstarts
Copy link

ref error after convertion

 "openapi": "3.0.1",
 "components": {
    "schemas": {
      "dnsaccountmdl.TRow": {
        "type": "object",
        "properties": {
          "auth_config": {
            "type": "object",
            "description": "auth config",
            "allOf": [{ "$ref": "#/definitions/dnsaccount.TAuthConfig" }]
          }

should be

"components": {
    "openapi": "3.0.1",
    "schemas": {
      "dnsaccountmdl.TRow": {
        "type": "object",
        "properties": {
          "auth_config": {
            "type": "object",
            "description": "auth config",
            "allOf": [{ "$ref": "#/components/schemas/dnsaccount.TAuthConfig" }]
          }
@carlos-evolutive
Copy link

carlos-evolutive commented Jun 14, 2024

Same error on this file:
HotelBooking_v2_Version_2.0_swagger_specification.json

Is there a way to solve this with some configuration?

I use a fix with a regex and sed meanwhile if anyone is interested:

  `if [[ "$OSTYPE" == "darwin"* ]]; then

      # macOS

      echo "Fixing # macOS $SPECS_DIR/$DEST_DIR/$filename"

      sed -i '' 's|"$ref":"#/definitions/|"$ref":"#/components/schemas/|g' "$SPECS_DIR/$DEST_DIR/$filename"

    else

      # Linux

      echo "Fixing # Linux $SPECS_DIR/$DEST_DIR/$filename"

      sed -i 's|"$ref":"#/definitions/|"$ref":"#/components/schemas/|g' "$SPECS_DIR/$DEST_DIR/$filename"
   
  fi`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants