OpenAPITools / OpenAPITools/openapi-generator

[REQ] Allow referencing vendor extensions at the path level

Open
#15,436 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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

I have the following two vendor extensions in my OpenAPI spec, x-foo-at-path-level and x-foo-at-operation-level:

    /pets:
      x-foo-at-path-level: true
      get:
        x-foo-at-operation-level: true
        responses:
          '200':
            description: A list of pets.
            content:
               ...

I'm able to reference x-foo-at-operation-level with the following in mustache:

{{#operations}}
  {{#operation}}
    {{vendorExtensions.x-foo-at-operation-level}} // able to reference this
  {{/operation}}
{{/operations}}

However, I'm not able to reference x-foo-at-path-level (or at least don't know how to).

Describe the solution you'd like

Please allow accessing the vendor extensions at the path level with {{../vendorExtensions.x-foo-at-path-level}} or similar syntax.

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

The issue names no file or test. Start by tracing how operation-level vendor extensions are exposed to Mustache templates, then compare that context with the path-level data available during generation. Done means a path-level extension is accessible from the template context as described, with coverage for the provided OpenAPI example.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.