Skip to content

OpenAPI 3.1: Be able to provide a description for OpenApiReference #2718

@SantiagoG14

Description

@SantiagoG14

Is your feature request related to a problem? Please describe.

yes, this feature req is related to a problem. With OpenAPI 3.1 and above you can now add description to references in properties. However, the constructor does not allow for a description to be passed in. I am wanting to update this for related issue in the SwashBuckleGen lib issue

this is what the current constructor looks like

OpenApiSchemaReference.cs

        public OpenApiSchemaReference(string referenceId, OpenApiDocument? hostDocument = null, string? externalResource = null) : base(referenceId, hostDocument, ReferenceType.Schema, externalResource)
        {
        }

maybe we can add something like this?

        public OpenApiSchemaReference(string referenceId, OpenApiDocument? hostDocument = null, string? externalResource = null, string? description = null) : base(referenceId, hostDocument, ReferenceType.Schema, externalResource)
        {
            Description = description;
        }

Describe the solution you'd like

I want to be able to create an OpenApiSchemaReference with a description property

Describe alternatives you've considered

Not sure if there already some work in order to make this happen? and I am missing some context

Additional context

Please see this issue to view the original problem I am trying to solve. Help would be much appreciate it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions