Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming issue with GitHub specification #4833

Open
kfcampbell opened this issue Jun 14, 2024 · 0 comments
Open

Naming issue with GitHub specification #4833

kfcampbell opened this issue Jun 14, 2024 · 0 comments
Labels
Go type:bug A broken experience
Milestone

Comments

@kfcampbell
Copy link
Member

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

Go

Describe the bug

(Please see reproduction steps below)

Kiota version: v1.15.0

Build error:

sh$ go build ./...
# github.com/octokit/temp/models
models/code_scanning_variant_analysis.go:35:13: undefined: CodeScanningVariantAnalysis_status
models/code_scanning_variant_analysis.go:207:36: undefined: ParseCodeScanningVariantAnalysis_status
models/code_scanning_variant_analysis.go:212:31: undefined: CodeScanningVariantAnalysis_status
models/code_scanning_variant_analysis.go:255:52: undefined: CodeScanningVariantAnalysis_status
models/code_scanning_variant_analysis.go:409:56: undefined: CodeScanningVariantAnalysis_status
models/code_scanning_variant_analysis.go:430:18: undefined: CodeScanningVariantAnalysis_status
models/code_scanning_variant_analysis.go:443:22: undefined: CodeScanningVariantAnalysis_status

It's interesting that the errors are limited to this specific model and this specific file. In this case, the file name (CodeScanningVariantAnalysis) minus the extension, is appearing in the file in place of the type name (CodeScanningVariantAnalysisStatus) and a simple find/replace in that file will cause the build to succeed without errors.

Expected behavior

I expect go build ./... to succeed without any output.

How to reproduce

Reproduction steps:

  • Download the latest GitHub schema from here
  • Using Kiota v1.15.0, run generation like so: kiota generate -l go --ll trace -o $(pwd)/temp -n github.com/octokit/temp -d schemas/downloaded.json --ebc
  • Change into wherever you generated your code: cd temp
  • Create a Go module from the generated code: go mod init github.com/octokit/temp && go mod tidy
  • Run go build ./...

Open API description file

https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json

Kiota Version

v1.15.0

Latest Kiota version known to work for scenario above?(Not required)

v1.14.0

Known Workarounds

  • Downgrade to Kiota v1.14.0
  • Use a find/replace step after building to replace the filename with the correct type name inside the file

Configuration

This occurs on any x64-based Ubuntu-derivative system (e.g. GitHub Actions, though that is also my local dev environment). I do not know if it's specific to this configuration.

Debug output

N/A

Other information

N/A

@kfcampbell kfcampbell added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jun 14, 2024
@msgraph-bot msgraph-bot bot added the Go label Jun 14, 2024
@baywet baywet removed the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Jun 17, 2024
@baywet baywet added this to the Backlog milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go type:bug A broken experience
Projects
Status: Todo 📃
Development

No branches or pull requests

2 participants