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

Include any parameters in content type unique names #232

Closed
czechboy0 opened this issue Aug 30, 2023 · 0 comments · Fixed by #236
Closed

Include any parameters in content type unique names #232

czechboy0 opened this issue Aug 30, 2023 · 0 comments · Fixed by #236
Labels
area/generator Affects: plugin, CLI, config file. kind/bug Feature doesn't work as expected. size/S Small task. (A couple of hours of work.)
Milestone

Comments

@czechboy0
Copy link
Contributor

The k8s API has the following:

        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatusList"
                }
              },
              "application/json;stream=watch": {
                "schema": {
                  "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatusList"
                }
              },

The generated code doesn't compile, because we generate duplicate enum cases, as the ;stream=watch is stripped.

It should instead be included and hashed into the unique name.

Since this is technically breaking, we should do it as part of 0.2.0.

@czechboy0 czechboy0 added area/generator Affects: plugin, CLI, config file. kind/bug Feature doesn't work as expected. size/S Small task. (A couple of hours of work.) labels Aug 30, 2023
@czechboy0 czechboy0 added this to the 0.2.0 milestone Aug 30, 2023
czechboy0 added a commit that referenced this issue Aug 31, 2023
Include parameters in the content type name

### Motivation

Fixes #232, which was blocking the Kubernetes OpenAPI doc from successfully generating and building.

### Modifications

Include parameters, such as `application/json; foo=bar` in the content type name, e.g. `application_json_foo_bar`.

### Result

#232 is fixed, verified already locally.

### Test Plan

Updated unit and snippet tests.


Reviewed by: gjcairo, glbrntt

Builds:
     ✔︎ pull request validation (5.8) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (docc test) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 
     ✖︎ pull request validation (integration test) - Build finished. 

#236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/generator Affects: plugin, CLI, config file. kind/bug Feature doesn't work as expected. size/S Small task. (A couple of hours of work.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant