Skip to content

protoc-gen-openapiv2 not generating objects with repeated defined objects #2457

Closed
@aethanol

Description

@aethanol

🐛 Bug Report

(not sure if this is actually a bug)

Updating from v2.0.1 -> 2.7.0 doesn't generate definitions for openapi objects that have a repeated other object. In this case the diff here: https://github.com/grafeas/grafeas/pull/525/files#diff-fc63bf57f2448a75b87e33e47f77ff96be847f6ce48546e973277dee7480d862L455

Is there an option to disable this behavior?

To Reproduce

(Write your steps here:)

  1. repeated proto: https://github.com/grafeas/grafeas/blob/master/proto/v1beta1/grafeas.proto#L561
  2. similar proto: https://github.com/grafeas/grafeas/blob/master/proto/v1beta1/grafeas.proto#L490
  3. gen command: https://github.com/grafeas/grafeas/blob/master/proto/v1beta1/generate.go#L4
  4. (easiest way to get this to work is to clone grafeas and make test, or go generate in the proto dir)

Expected behavior

Two openapi objects: #/definitions/v1beta1BatchCreateNotesRequest, and #/definitions/v1beta1Note.

Actual Behavior

The generated openapi simplifies the repeated object in line.

https://github.com/grafeas/grafeas/pull/525/files#diff-fc63bf57f2448a75b87e33e47f77ff96be847f6ce48546e973277dee7480d862L455

Your Environment

golang, macos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions