Skip to content

Instantly share code, notes, and snippets.

@itinance
Created April 11, 2020 21:20
Show Gist options
  • Save itinance/74a8486d06ca34d6ff3f7f21334e330c to your computer and use it in GitHub Desktop.
Save itinance/74a8486d06ca34d6ff3f7f21334e330c to your computer and use it in GitHub Desktop.

Revisions

  1. itinance created this gist Apr 11, 2020.
    15 changes: 15 additions & 0 deletions fix-swaggger-files.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/usr/bin/env bash

    # (C) 2020 Hagen Huebel, ITinance GmbH https://itinance.com, dedified GmbH https://dedified.io
    # All rights reserved.

    # fix-swagger-models
    # swaggo/swag has a bug that will prevent renaming of Models from "model.Account" ino "Account"
    # we are going to fix this generation with this command
    # the "-i ''" is a fix for sed required on Mac to avoid the auto-creation of backup-files

    if [ "$(uname)" == "Darwin" ]; then
    sed -i '' -e 's/model\.//g' docs/*
    else
    sed -i -e 's/model\.//g' docs/*
    fi