Features headers to remove not working
See original GitHub issueUsing the new 1.4.0 version and the previous one 1.3.0, headers to remove function isn’t working.
This is the output of my successful generateSwagger task:
> Task :app:generateSwagger
Successfully read version from Swagger Spec file: 1.1.0
####################
Yelp Swagger Codegen
####################
Platform kotlin-coroutines
Package com.my.super.project
specName [ DEFAULT ] defaultname
specVers 1.1.0
input /home/projects/app/swagger.json
output /home/projects/app/src/main/java
groupId com.my.super.project
artifactId com.my.super.project
features X-HTTP-Method-Override, X-Operation-ID, Content-Type
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
10:09:41 PM: Task execution finished 'generateSwagger'.
And this is my gradle configuration:
generateSwagger {
platform = "kotlin-coroutines"
packageName = "com.my.super.project"
outputDir = file("./src/main/java/")
features {
headersToRemove = ["X-HTTP-Method-Override", "X-Operation-ID", "Content-Type"]
}
inputFile = file("../swagger/destination/PointsOfInterest_v1_Swagger_specification.json")
}
And this is the output of my Api:
@Headers(
"X-Operation-ID: getPointOfInterest",
"Content-Type: application/json"
)
@GET("api/{poisId}")
suspend fun getPointOfInterest(
@retrofit2.http.Path("poisId") poisId: String
): Map<String, Any?>
By the awesome project and thx for the help !
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Headers.delete() - Web APIs - MDN Web Docs
The delete() method of the Headers interface deletes a header from the current Headers object.
Read more >Remove all headers and footers - Microsoft Support
How to remove headers and/or footers from a Word document. ... Go to Insert > Header or Footer, and then select Remove Header...
Read more >Can't remove headers after they are sent - Stack Overflow
If it is undefined , I would guess req.body is not being populated correctly OR it is an asynchronous node problem.
Read more >Remove HTTP headers | Drupal.org
Also removes <meta name="Generator" content="Drupal 8 (https://www.drupal.org)"> from the <head> tag if the X-Generator HTTP header is ...
Read more >Remove Specified HTTP Response Headers in PCF does not ...
The feature, 'Operator can specify headers to be stripped from the response by the router' does not work in the Ops Manager tile....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So @pietrini version
1.4.1
is out with this fix.I’d go for a
1.4.1
release since2.x
will require more effort to integrate. But I’m not the one doing the releases so that’s the easy choice 😃