Skip to content

Instantly share code, notes, and snippets.

@mkanoor
Created March 11, 2020 17:48
Show Gist options
  • Save mkanoor/802eb64217e04e4e7b5fc12ac4ebf8c5 to your computer and use it in GitHub Desktop.
Save mkanoor/802eb64217e04e4e7b5fc12ac4ebf8c5 to your computer and use it in GitHub Desktop.
OpenAPI Generation Issue with forward slash
openapi: 3.0.1
info:
title: Test Regex generation for parameter validation
version: 1.0.0
components:
responses:
OK_200:
description: OK
paths:
/ping:
get:
summary: Get Payment Information
description: Returns the content of a payment object
parameters:
- name: pattern_no_forward_slashes
in: header
schema:
type: string
pattern: '^pattern$'
- name: pattern_two_slashes
in: header
schema:
type: string
pattern: '/^pattern$/i'
- name: pattern_dont_escape_backslash
in: header
schema:
type: string
pattern: '/^pattern\d{3}$/i'
- name: alternation_with_forward_slash
in: header
schema:
type: string
pattern: '/ax$|/bx$'
- name: patten_starts_ends_with_slash
in: header
schema:
type: string
pattern: '/root/'
description: 'Should match only /root/ but not root'
responses:
'200':
$ref: "#/components/responses/OK_200"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment