swagger-api / swagger-api/swagger-codegen

[codegen]{ze-ph} Lack of implementation for http HEAD method in ZendExpressivePathHandlerServerCodegen

Open
#6,491 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted Issue: Bug Server: PHP
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

During generation of ze-ph code , codegen throws exception:

Exception in thread "main" java.lang.RuntimeException: Could not generate api file for '/servers' at io.swagger.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:463) at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:666) at io.swagger.codegen.cmd.Generate.run(Generate.java:234) at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:41) Caused by: java.lang.RuntimeException: Unknown HTTP Method HEAD not allowed at io.swagger.codegen.languages.ZendExpressivePathHandlerServerCodegen.postProcessOperations(ZendExpressivePathHandlerServerCodegen.java:150) at io.swagger.codegen.DefaultGenerator.processOperations(DefaultGenerator.java:885) at io.swagger.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:380) ... 3 more

Swagger-codegen version

swagger-codegen-cli-2.2.2

Command line used for generation

java -jar swagger-codegen-cli-2.2.2.jar generate -i http://host:port/some-service/swagger.json -l ze-ph -o /tmp/ze-ph

Suggest a fix/enhancement

Implement code for missing http methods in ZendExpressivePathHandlerServerCodegen.java

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

Start in ZendExpressivePathHandlerServerCodegen.java, especially postProcessOperations, and reproduce the failure with the supplied swagger-codegen-cli command using a definition containing HEAD. Done means ze-ph generation no longer throws “Unknown HTTP Method HEAD” and the generated /servers API is produced.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, php
Domain
backend, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.