Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI: add several features #3258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Units/parser-openapi.r/openapi.d/expected.tags
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
title input.yaml /^ title: test$/;" I
description input.yaml /^ description: test$/;" I
version input.yaml /^ version: '1.0'$/;" I
http://example.com input.yaml /^ - url: http:\/\/example.com$/;" S
http://example2.com input.yaml /^ - url: http:\/\/example2.com$/;" S
/sample/path input.yaml /^ \/sample\/path:$/;" p
/sample/other/path input.yaml /^ \/sample\/other\/path:$/;" p
NullableField input.yaml /^ NullableField:$/;" d
NullableFieldStringEnum input.yaml /^ NullableFieldStringEnum:$/;" d
CustomHeader input.yaml /^ CustomHeader:$/;" P
Response1 input.yaml /^ Response1:$/;" R
Response2 input.yaml /^ Response2:$/;" R
Example1 input.yaml /^ Example1:$/;" e
Example2 input.yaml /^ Example2:$/;" e
Body1 input.yaml /^ Body1:$/;" B
Body2 input.yaml /^ Body2:$/;" B
Header1 input.yaml /^ Header1:$/;" h
Header2 input.yaml /^ Header2:$/;" h
SSchema1 input.yaml /^ SSchema1:$/;" C
SSchema2 input.yaml /^ SSchema2:$/;" C
Link1 input.yaml /^ Link1: {}$/;" l
Link2 input.yaml /^ Link2: {}$/;" l
Callback1 input.yaml /^ Callback1: {}$/;" c
Callback2 input.yaml /^ Callback2: {}$/;" c
PathItem1 input.yaml /^ PathItem1: {}$/;" A
PathItem2 input.yaml /^ PathItem2: {}$/;" A
SomeApiKey input.yaml /^ - SomeApiKey:$/;" s
android_handler input.yaml /^ - name: android_handler$/;" t
ios_handler input.yaml /^ - name: ios_handler$/;" t
http://example.com input.yaml /^ url: http:\/\/example.com$/;" D
66 changes: 65 additions & 1 deletion Units/parser-openapi.r/openapi.d/input.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.0.0
openapi: 3.1.0
info:
title: test
description: test
Expand All @@ -7,6 +7,8 @@ info:
servers:
- url: http://example.com
description: production
- url: http://example2.com
description: testing

paths:
/sample/path:
Expand Down Expand Up @@ -53,3 +55,65 @@ components:
schema:
type: object
properties: {}
examples:
Copy link
Member

@masatake masatake Mar 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X I'm talking about these.

Example1:
summary: xxx
value: yyyyy
Example2:
summary: xxx
value: yyyyy
requestBodies:
Body1:
description: bla bla bla
content:
application/json:
schema:
type: string
Body2:
description: bla bla bla
content:
application/json:
schema:
type: integer
headers:
Header1:
schema:
type: string
Header2:
schema:
type: string
securitySchemes:
SSchema1:
type: http
scheme: basic
SSchema2:
type: http
scheme: basic
links:
Link1: {}
Link2: {}
callbacks:
Callback1: {}
Callback2: {}
# pathItems is allowed in 3.1.0
pathItems:
PathItem1: {}
PathItem2: {}



security:
- {}
- SomeApiKey:
- foo:read
- foo:write

tags:
- name: android_handler
description: Handler for Android clients
- name: ios_handler
description: Handler for iOS clients

externalDocs:
description: some docs
url: http://example.com
3 changes: 3 additions & 0 deletions Units/parser-openapi.r/swagger.d/expected.tags
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
description input.yaml /^ description: test$/;" I
title input.yaml /^ title: test$/;" I
version input.yaml /^ version: '1.0'$/;" I
/sample/path input.yaml /^ \/sample\/path:$/;" p
/sample/other/path input.yaml /^ \/sample\/other\/path:$/;" p
PolymorphicString input.yaml /^ PolymorphicString:$/;" d
Expand Down
Loading