swagger-api / swagger-api/swagger-codegen
Regex pattern not generated for input type header
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Im trying to generate the API from a swagger 2.0 yml file, and I want to have for headers a specific regex pattern.
Swagger-codegen version that I'm using is: 2.3.1
An example would be:
.....
parameters:
- name: Header that I want
description: some description
required: true
in: header
type: string
pattern: ^[a-zA-Z0-9]{8}-?[a-zA-Z0-9]{4}-?[a-zA-Z0-9]{4}-?[a-zA-Z0-9]{4}-?[a-zA-Z0-9]{12}$
maxLength: 36
When generating the API, the regeq pattern annotation is not created, and therefore it's not apply this regex.
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 by reproducing the issue with the supplied Swagger 2.0 YAML example using swagger-codegen 2.3.1. Check the generated header parameter handling and its treatment of the pattern field; done means the generated API applies the specified regular-expression constraint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- yaml
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100