swagger-api / swagger-api/swagger-codegen
[PHP][Lumen] body name parameter should be ignore
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When I generate a Lumen server stub from swagger editor online, generated controller has param validation for body name. Documentation here
say that this name is ignored but Lumen Stub has check for body name parameter.
Swagger-codegen version
online swagger editor 2.2.3
Swagger declaration file content or url
paths:
/visite:
post:
security:
- api_key: []
tags:
- Visite
summary: Ajouter une visite
description: ''
operationId: addVisite
consumes:
- application/json
produces:
- application/json
parameters:
- name: body
in: body
description: Objet visite à ajouter
required: true
schema:
$ref: '#/definitions/Visite'
Lumen stub has this check :
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling addVisite');
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated PHP Lumen controller and its body-parameter validation shown in the issue, then trace back to the Lumen server stub template that produces it. Compare the validation with the Swagger 2.0 request-body rules and update the behavior so the body parameter name is ignored; confirm generation and request validation no longer require that name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100