Skip to content
Snippets Groups Projects
Select Git revision
  • 9f27c2d656eb51a7ad35dc7193e35e97186fb397
  • master default protected
  • fgh-updated-cw
  • cuda-solver-fix
  • fix-rocky-dockerfile
  • fgh-ba-mielchen
  • fgh-updated-base
  • i-nergy-ASM
  • emt-syngen-trstab
  • mnasolver-plugins
  • vs-signal-gen-follow-up-rebase6
  • fgh_cw_csv_sourcereader
  • sg-controllers
  • slew-scenarios-all-updated-villas
  • 4OrderSG-iter
  • SynGenModels
  • syngen-vbr-nicslu
  • slew-scenarios-all
  • slew-scenario-2
  • gh-actions
  • villas-interface
  • v1.0.0
  • v0.1.6
  • v0.1.5
  • v0.1.3
  • v0.1.1
  • v0.1.0
27 results

VoltageBehindReactanceEMT.cpp

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    generate-api-client.sh 2.34 KiB
    #!/bin/bash
    
    # --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    # Generate TypeScript API Client using OpenAPI Generator:
    # --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    # This script generates a TypeScript API client based on the OpenAPI specification.
    #
    # The actions performed are:
    # - Generating the API client code using podman (make sure it's available).
    # - Deleting existing API client source files.
    # - Copying the newly generated API client source to the project directory.
    # - Cleaning up temporary files.
    #
    # Defined variables:
    OUTPUT_DIR="temp"                                     # The temporary directory for generated files
    PACKAGE_NAME="Coscine.Api"                            # The package name for the API client
    API_SPEC_URL="https://coscine-hristov.web.vulcanus.otc.coscine.dev/coscine/api/swagger/v2/swagger.json" # URL to the OpenAPI spec file
    # --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    # ANSI color codes for styling
    GREEN='\033[0;32m'
    YELLOW='\033[0;33m'
    CYAN='\033[0;36m'
    NC='\033[0m' # No Color
    
    # Run the OpenAPI generator
    echo -e "${CYAN}Running the OpenAPI generator...${NC}"
    podman run --rm \
      -v ${PWD}:/local openapitools/openapi-generator-cli generate \
      -i "$API_SPEC_URL" \
      -g typescript-axios \
      -o /local/$OUTPUT_DIR \
      --additional-properties=useSingleRequestParameter=true,apiPackage=@coscine/api,modelPackage=@coscine/model,withSeparateModelsAndApi=true,enumPropertyNaming=original \
      --skip-validate-spec
    
    echo -e "${GREEN}API client generation complete.${NC}"
    
    # Delete the current API client source
    echo -e "${YELLOW}Deleting current API client source...${NC}"
    rm -rf "src/$PACKAGE_NAME"
    
    # Copy the generated API client source to the src directory
    echo -e "${CYAN}Copying generated API client source to src directory...${NC}"
    cp -r "$OUTPUT_DIR/" "src/$PACKAGE_NAME"
    
    # Remove the temp directory
    echo -e "${YELLOW}Cleaning up...${NC}"
    rm -rf "$OUTPUT_DIR"
    
    echo -e "${GREEN}Finished.${NC}"
    
    echo -e "${YELLOW}Don't forget to add newly generated apis to apis.ts and index.ts!!${NC}"