OpenAPITools / OpenAPITools/openapi-generator

[BUG] sharp-giraffe-server creates project with Nuget ref to a deleted package

Open
#4,568 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug Server: F#
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)? (N/A)
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The generator for fsharp-giraffe-server generates a project which has a reference to a Nuget package which has since been deleted, i.e. AspNet.Security.ApiKey.Providers.

openapi-generator version

4.2.1

OpenAPI declaration file content or url

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

Command line used for generation
openapi-generator generate -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml -g fsharp-giraffe-server -o ./petstore
Steps to reproduce
  • Install v4.2.1

  • Run command line above

  • cd petstore/OpenAPI

  • ./build.bat or ./build.sh

  • Note error:

    OpenAPI.fsproj : error NU1101: Unable to find package AspNet.Security.ApiKey.Providers. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget, (our private feeds)

  • Edit src/OpenAPI.fsproj, note reference to AspNet.Security.ApiKey.Providers

  • Navigate to https://www.nuget.org/packages/AspNet.Security.ApiKey.Providers/

  • Note 'This package has been deleted from the gallery`.

Related issues/PRs

None found.

Suggest a fix

Not sure what role the missing package was intended to take, but I guess we need to either:

  • Remove the reference in the generated code and remove any - presumably optional - generated code which would have used the package OR
  • Identify a replacement package to perform the same role and amend generated code accordingly.

(The output of the generator looks very good apart from this, so I'm hoping this issue will be easy to fix ;-) .)

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 issue with the provided petstore.yaml command, then inspect the generated src/OpenAPI.fsproj for the AspNet.Security.ApiKey.Providers reference. Trace the fsharp-giraffe-server generator output to determine whether the reference is required; done means the generated project builds successfully without referencing the deleted package.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.