Zum Hauptinhalt springen
•
YouTube Security VideosVisual Studio Code: New in VS Code v1.142(16.10.2026 um 15:45 Uhr)
•
YouTube Security VideosNASA: U.S. Spacewalk Preview News Conference (Oct. 20, 2026)(15.10.2026 um 18:05 Uhr)
••
Windows Tipps & SecurityRTX Spark: Local AI First Steps ⭐(16.10.2026 um 15:32 Uhr)
•
Windows Tipps & SecurityPC won’t boot after installing a second SSD(16.10.2026 um 13:37 Uhr)
•
Windows Tipps & SecurityXbox 25(16.10.2026 um 14:20 Uhr)
•
Windows Tipps & SecuritySwitch emulation hits Xbox Series X (and it's good)(16.10.2026 um 15:45 Uhr)
••••
YouTube Security VideosVisual Studio Code: New in VS Code v1.142(16.10.2026 um 15:45 Uhr)
•
YouTube Security VideosNASA: U.S. Spacewalk Preview News Conference (Oct. 20, 2026)(15.10.2026 um 18:05 Uhr)
••
Windows Tipps & SecurityRTX Spark: Local AI First Steps ⭐(16.10.2026 um 15:32 Uhr)
•
Windows Tipps & SecurityPC won’t boot after installing a second SSD(16.10.2026 um 13:37 Uhr)
•
Windows Tipps & SecurityXbox 25(16.10.2026 um 14:20 Uhr)
•
Windows Tipps & SecuritySwitch emulation hits Xbox Series X (and it's good)(16.10.2026 um 15:45 Uhr)
•••
Intelligence View
⚡ tsecurity.de Intelligence

Swagger Codegen and Multiple Tags

Today ChatGPT lied to me, so I’m setting the record straight. This is my question: “If an endpoint in an OpenAPI spec has multiple tags, what will Swagger Cod…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

Today ChatGPT lied to me, so I’m setting the record straight. This is my question: “If an endpoint in an OpenAPI spec has multiple tags, what will Swagger Codegen do?”. Because Swagger Codegen organized the generated code into api/tag_name_api files. So what if there’s multiple tags? Does it take the first tag? The last tag? Or does it generate a file for each tag and give it the same behavior? ChatGPT claimed it takes only the first tag. I’ve already revealed that’s false, so I guess I don’t have any dramatic reveal, so let me just spout the details for you.






Methodology



I used Swagger Codegen V3 Online Generator: https://swagger.io/docs/open-source-tools/swagger-codegen/codegen-v3/online-generators/



I POST ‘ed to https://generator3.swagger.io/api/generate on 2/9/2026 with a payload looking like this:




  "specURL" : "my.code/openapi/v3/swagger.yaml",
"lang" : "ruby",
"options" : {
"gemName": "liar-liar-pants-on-fire",
"gemRequiredRubyVersion": ">= 3.1.4",
"gemSummary": "Liar Liar Pants on FIRE",
"gemDescription": "",
"gemAuthor": "Me"
},
"type" : "CLIENT",
"codegenVersion" : "V3"
}






The swagger had tag sections that looked like this (two endpoints, each with one differing tag and one common tag)




get:
summary: Get thingy
operationId: getThingy
tags:
- Better Grouping
- Thingies
get:
summary: Get whatchamacallit
operationId: getWhatchamacallit
tags:
- Better Grouping
- Whatchamacallits









Results



The generated code had three files api/better_grouping_api.rb, api/thingies_api.rb, and api/whatchamacallits_api.rb.



And wouldn’t you know it, better_grouping_api had the code to call both endpoints and the thingies_api and whatchamacallits_api had the duplicated code for their correspondingly tagged endpoint.



So there you go, if you have OpenAPI spec with multiple tags, it looks like Swagger Codegen v3 will yield the behavior under each of the tag_api files it generates for each tag.

Intelligence Digest — kostenlos Täglich die wichtigsten Security-News · jederzeit abbestellbar
Community Rating & Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War diese Seite hilfreich?
0
Jetzt Bewertung abgeben
🟢 Niedrig (1-3.9) 🟡 Mittel (4.0-6.9) 🔴 Hoch (7.0-8.9) Kritisch (9.0-10.0)
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Swagger Codegen and Multiple Tags

Thematisch verwandte Begriffe: Swagger, Codegen, Multiple, Tags · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag