Skip to content

4.0.x html template doesn't load header parameters #1566

Closed
@jmalin-splunk

Description

@jmalin-splunk
Description

The index.mustache template for v4 openapi-generator in
openapi-generator/modules/openapi-generator/src/main/resources/htmlDocs
doesn't load header parameters for a request or a response.

openapi-generator version

4.0.0-SNAPSHOT

OpenAPI declaration file content or url

https://gist.github.com/jmalin-signalfx/4ac72d4e651608da8f36c1b5ba856d3b

Command line used for generation

#!/usr/local/bin/bash
export apidir="/Users/joemalin/src/api-reference"
if [ -f "${apidir}/html-output/oas-html-v4/${1}_api.html" ]; then
rm ${apidir}/html-output/oas-html-v4/${1}api.html
fi
java -jar /Users/joemalin/src/openapi-generator-4/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate
--lang 'html'
--input-spec
--output ${apidir}/html-output/oas-html-v4 > ${apidir}/html-output/oas-html-v4/oas4-runlog-$(date +%F
%T%z).log
mv html-output/oas-html-v4/index.html html-output/oas-html-v4/${1}_api.html

Steps to reproduce
  1. do git clone of openapi-generator to openapi-generator-v4
  2. cd openapi-generator-v4
  3. mvn clean install
  4. run script as shown
  5. Open resulting web page. Request headers title shows, but no request headers appear.
Related issues/PRs

Not that I can see.

Suggest a fix/enhancement

I'm unable to determine how the generator parses YAML specs into variables that are usable by the mustached templates, so I can't do a thorough debug. If someone gives me a map between the YAML keys and their variable names, I could do more.

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