Skip to content

Custom server tutorials raise an error while swagger generates files #2833

@RomanOrlovDev

Description

@RomanOrlovDev

Problem statement

Error is raised while server generation

Swagger specification


swagger: '2.0'
info:
version: 1.0.0
title: Greeting Server
paths:
/hello:
get:
produces:
- text/plain
parameters:
- name: name
required: false
type: string
in: query
description: defaults to World if not given
operationId: getGreeting
responses:
200:
description: returns a greeting
schema:
type: string
description: contains the actual greeting as plain text

Steps to reproduce

I am going though tutorial https://goswagger.io/tutorial/custom-server.html
When it is required to generate server by command
swagger generate server -t gen -f ./swagger/swagger.yml --exclude-main -A greeter
I some across the error:
could not evaluate base import path with target "<here is an absolute path to gen folder>" (with symlink resolution): lstat <<here is an absolute path to gen folder>: no such file or directory

Environment

swagger version:v0.30.2
go version: go1.18.4 linux/amd64
OS: WSL 2, Ubuntu 20.04 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    docgeneratorneeds testingNeeds more testing for issue confirmation/qualification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions