Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !6642

[Extensions][Go][Java] Test x-auth-id-alias

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/jirikuncar/extensions/x-auth-id-alias into master 5 years ago
  • Overview 0
  • Commits 5
  • Pipelines 0
  • Changes 64

Created by: jirikuncar

Adds tests for go-experimental to test x-auth-id-alias extension.

Based on discussion in #6469.

  • Go test file: https://github.com/OpenAPITools/openapi-generator/pull/6642/files#diff-8e0352a3f9f1548beef9453992b7719d

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/config/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

cc @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) @kemokemo (2018/09) @bkabrda (2019/07)

Compare
  • master (base)

and
  • latest version
    1b2477a5
    5 commits, 2 years ago

64 files
+ 6844
- 28

    Preferences

    File browser
    Compare changes
bin/c‎onfigs‎
go-experimental-extensi‎ons-x-auth-id-alias.yaml‎ +6 -0
java-jersey2-extension‎s-x-auth-id-alias.yaml‎ +7 -0
python-experimental-exten‎sions-x-auth-id-alias.yaml‎ +0 -0
modules/…/…/…/…‎/go-experimental‎
api.mu‎stache‎ +15 -4
sam‎ples‎
client/petstor‎e/…/go-petstore‎
api_fake_class‎name_tags123.go‎ +4 -4
api_p‎et.go‎ +4 -4
api_st‎ore.go‎ +4 -4
openapi‎3/client‎
extensions/x-‎auth-id-alias‎
go-expe‎rimental‎
.openapi-‎generator‎
FI‎LES‎ +13 -0
VER‎SION‎ +1 -0
a‎pi‎
openap‎i.yaml‎ +114 -0
do‎cs‎
Usage‎Api.md‎ +256 -0
.giti‎gnore‎ +24 -0
.openapi-gen‎erator-ignore‎ +23 -0
.trav‎is.yml‎ +8 -0
READ‎ME.md‎ +126 -0
api_us‎age.go‎ +490 -0
api_usag‎e_test.go‎ +120 -0
clie‎nt.go‎ +532 -0
configur‎ation.go‎ +262 -0
git_p‎ush.sh‎ +58 -0
go.‎mod‎ +7 -0
go.‎sum‎ +15 -0
respo‎nse.go‎ +46 -0
util‎s.go‎ +334 -0
java/jers‎ey2-java8‎
.openapi-‎generator‎
FI‎LES‎ +33 -0
VER‎SION‎ +1 -0
a‎pi‎
openap‎i.yaml‎ +119 -0
do‎cs‎
Usage‎Api.md‎ +296 -0
gradle/‎wrapper‎
gradle-wr‎apper.jar‎ +0 -0
gradle-wrapp‎er.properties‎ +5 -0
s‎rc‎
ma‎in‎
java/org/opena‎pitools/client‎
a‎pi‎
UsageA‎pi.java‎ +287 -0
au‎th‎
ApiKeyA‎uth.java‎ +79 -0
Authentic‎ation.java‎ +33 -0
HttpBasic‎Auth.java‎ +60 -0
HttpBeare‎rAuth.java‎ +62 -0
mo‎del‎
AbstractOpenA‎piSchema.java‎ +149 -0
ApiClie‎nt.java‎ +1149 -0
ApiExcep‎tion.java‎ +94 -0
ApiRespo‎nse.java‎ +74 -0
Configura‎tion.java‎ +39 -0
CustomInstantDe‎serializer.java‎ +232 -0
JSON‎.java‎ +252 -0
Pair‎.java‎ +61 -0
RFC3339Date‎Format.java‎ +55 -0
ServerConfig‎uration.java‎ +58 -0
ServerVar‎iable.java‎ +23 -0
StringU‎til.java‎ +83 -0
AndroidMa‎nifest.xml‎ +3 -0
test/java/org/open‎apitools/client/api‎
UsageApi‎Test.java‎ +91 -0
.giti‎gnore‎ +21 -0
.openapi-gen‎erator-ignore‎ +23 -0
.trav‎is.yml‎ +22 -0
READ‎ME.md‎ +155 -0
build.‎gradle‎ +125 -0
buil‎d.sbt‎ +26 -0
git_p‎ush.sh‎ +58 -0
gradle.p‎roperties‎ +2 -0
gra‎dlew‎ +183 -0
gradl‎ew.bat‎ +100 -0
pom‎.xml‎ +309 -0
setting‎s.gradle‎ +1 -0
petstore/go-experi‎mental/go-petstore‎
api_fake_class‎name_tags123.go‎ +4 -4
api_p‎et.go‎ +4 -4
api_st‎ore.go‎ +4 -4
bin/configs/go-experimental-extensions-x-auth-id-alias.yaml 0 → 100644
+ 6
- 0
  • View file @ 1b2477a5

  • Edit in single-file editor

  • Open in Web IDE

generatorName: go-experimental
outputDir: samples/openapi3/client/extensions/x-auth-id-alias/go-experimental
inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml
templateDir: modules/openapi-generator/src/main/resources/go-experimental
additionalProperties:
packageName: x_auth_id_alias
bin/configs/java-jersey2-extensions-x-auth-id-alias.yaml 0 → 100644
+ 7
- 0
  • View file @ 1b2477a5

  • Edit in single-file editor

  • Open in Web IDE

generatorName: java
outputDir: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8
library: jersey2
inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml
additionalProperties:
artifactId: openapi3-extensions-x-auth-id-alias-jersey2-java8
hideGenerationTimestamp: true
bin/configs/python-experimental-extensions-x-auth-alias.yaml → bin/configs/python-experimental-extensions-x-auth-id-alias.yaml
+ 0
- 0
  • View file @ 1b2477a5

  • Edit in single-file editor

  • Open in Web IDE

Unable to load file contents. Try again later.
File renamed with no changes. Show file contents
modules/openapi-generator/src/main/resources/go-experimental/api.mustache
+ 15
- 4
  • View file @ 1b2477a5

  • Edit in single-file editor

  • Open in Web IDE


@@ -252,13 +252,24 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if auth, ok := auth["{{#vendorExtensions.x-auth-id-alias}}{{.}}{{/vendorExtensions.x-auth-id-alias}}{{^vendorExtensions.x-auth-id-alias}}{{name}}{{/vendorExtensions.x-auth-id-alias}}"]; ok {
{{#vendorExtensions.x-auth-id-alias}}
if apiKey, ok := auth["{{.}}"]; ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
if prefix, ok := auth["{{name}}"]; ok && prefix.Prefix != "" {
key = prefix.Prefix + " " + apiKey.Key
} else {
key = auth.Key
key = apiKey.Key
}
{{/vendorExtensions.x-auth-id-alias}}
{{^vendorExtensions.x-auth-id-alias}}
if apiKey, ok := auth["{{name}}"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
{{/vendorExtensions.x-auth-id-alias}}
{{#isKeyInHeader}}
localVarHeaderParams["{{keyParamName}}"] = key
{{/isKeyInHeader}}
samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go
+ 4
- 4
  • View file @ 1b2477a5

  • Edit in single-file editor

  • Open in Web IDE


@@ -97,12 +97,12 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) {
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if auth, ok := auth["api_key_query"]; ok {
if apiKey, ok := auth["api_key_query"]; ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = auth.Key
key = apiKey.Key
}
localVarQueryParams.Add("api_key_query", key)
}
0 Assignees
None
Assign to
0 Reviewers
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: github/fork/jirikuncar/extensions/x-auth-id-alias

Menu

Explore Projects Groups Snippets