swagger-api / swagger-api/swagger-codegen

Errors generated .net server code

Open
#9,172 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

From @stevenbaylor on February 13, 2019 14:52

  • OS: Windows 10
  • Browser: Chrome
  • Version: 72.0.3626.96 (Official Build) (64-bit)
  • Method of installation: online editor
  • Swagger-Editor version: online
  • Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration

Example Swagger/OpenAPI definition:
https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml

Describe the bug you're encountering

The "aspnetcore" server code does not build. Seems to have missing path separators in build.bat and IO.Swagger.sln

To reproduce...
  1. Browse to https://editor.swagger.io
  2. File -> Import URL: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
  3. Generate Server -> aspnetcore
  4. Save zip file
  5. Extract zip file
  6. Launch build.bat

Output:

PS C:\Users\Steve\Documents\swagger\dotnet_codegen_test\aspnetcore-server-generated> .\build.bat
MSBUILD : error MSB1009: Project file does not exist.
Switch: srcIO.Swagger
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: srcIO.Swagger
Now, run the following to start the project: dotnet run -p srcIO.SwaggerIO.Swagger.csproj --launch-profile web.

PS C:\Users\Steve\Documents\swagger\dotnet_codegen_test\aspnetcore-server-generated>
Expected behavior

Successful build

Additional context or thoughts

Path separators (\) seem to be missing in:

  • build.bat - lines 6,7,8
  • IO.Swagger.sln - line 5

Copied from original issue: swagger-api/swagger-editor#1949

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report by importing the petstore.yaml example in Swagger Editor, generating the aspnetcore server, and running build.bat on Windows. Inspect build.bat lines 6–8 and IO.Swagger.sln line 5; done means the generated project builds successfully and the displayed dotnet run command uses valid paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.