OpenAPITools / OpenAPITools/openapi-generator

[BUG] Functions described in documentation but not present in code

Open
#20,007 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

[BUG] Functions described in documentation but not present in code

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

After generation some functions are explained in the documentation but they does not exist in the code.
Unfortunately I need these functions.

After generation:

$ grep -R SetDefaultNil docs/*
docs/CustomField.md:### SetDefaultNil
docs/CustomField.md:`func (o *CustomField) SetDefaultNil(b bool)`
docs/CustomField.md: SetDefaultNil sets the value for Default to be an explicit nil
docs/CustomFieldRequest.md:### SetDefaultNil
docs/CustomFieldRequest.md:`func (o *CustomFieldRequest) SetDefaultNil(b bool)`
docs/CustomFieldRequest.md: SetDefaultNil sets the value for Default to be an explicit nil
docs/PatchedWritableCustomFieldRequest.md:### SetDefaultNil
docs/PatchedWritableCustomFieldRequest.md:`func (o *PatchedWritableCustomFieldRequest) SetDefaultNil(b bool)`
docs/PatchedWritableCustomFieldRequest.md: SetDefaultNil sets the value for Default to be an explicit nil
docs/WritableCustomFieldRequest.md:### SetDefaultNil
docs/WritableCustomFieldRequest.md:`func (o *WritableCustomFieldRequest) SetDefaultNil(b bool)`
docs/WritableCustomFieldRequest.md: SetDefaultNil sets the value for Default to be an explicit nil
$ grep -R SetDefaultNil *.go
$
openapi-generator version

v7.9.0

I don't think that it's a regression.

OpenAPI declaration file content or url
default:                                                                                    
  nullable: true                                                                            
  description: Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo").

Complete file: https://raw.githubusercontent.com/netbox-community/go-netbox/refs/tags/v4.0.3-0/api/openapi.yaml

Generation Details
Steps to reproduce
$ git clone git@github.com:netbox-community/go-netbox.git
$ git checkout v4.0.3-0
$ make
$ make build
Related issues/PRs

I tried to look at the current issues but there is so much issues, perhaps some of them are related to this issue ...

Suggest a fix

Not able to fix the issue for the moment.

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 generation using the linked openapi.yaml, the v4.0.3-0 go-netbox checkout, and the listed make and make build commands. Compare docs/CustomField.md and the other docs containing SetDefaultNil with the generated *.go files; done means the documented functions and generated code agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, openapi
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.