Skip to content

Instantly share code, notes, and snippets.

View frantuma's full-sized avatar

Francesco Tumanischvili frantuma

View GitHub Profile
// Model class
public class Pet {
private ThrowableModel throwableModel;
private String name;
public ThrowableModel getThrowableModel() {
return throwableModel;
}
@frantuma
frantuma / MainTest.java
Last active August 11, 2018 12:20
parser test ticket #797
import io.swagger.parser.OpenAPIParser;
import io.swagger.util.Yaml;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.parser.core.models.ParseOptions;
import org.testng.annotations.Test;
public class MainTest {
@Test
public void test() throws Exception {
openapi: 3.0.1
servers:
- url: /api/v3
info:
version: 1.0.0
paths:
/pet:
put:
summary: Update an existing pet
description: Update an existing pet by Id
swagger: '2.0'
info:
description: |
This is a sample Petstore server. You can find
out more about Swagger at
[http://swagger.io](http://swagger.io) or on
[irc.freenode.net, #swagger](http://swagger.io/irc/).
version: 1.0.0
title: Swagger Petstore
termsOfService: http://swagger.io/terms/
@frantuma
frantuma / swagger-parser-ticket-901-ref1
Last active November 2, 2018 11:22
swagger-parser-ticket-901
### Domains, a place to put your reusable components
info:
title: "aa"
description: "swos55"
version: '1.0.0'
definitions:
Test.Definition:
{"swagger":"2.0","infos":{"description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.","version":"1.0.0","title":"Swagger Petstore","termsOfService":"http://swagger.io/terms/","contact":{"email":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"host":"petstore.swagger.io","basePath":"/v2","tags":[{"name":"pet","description":"Everything about your Pets","externalDocs":{"description":"Find out more","url":"http://swagger.io"}},{"name":"store","description":"Access to Petstore orders"},{"name":"user","description":"Operations about user","externalDocs":{"description":"Find out more about our store","url":"http://swagger.io"}}],"schemes":["https","http"],"paths":{"/pet":{"post":{"tags":["pet"],"summary":"Add a new pet to the store
{"openapi":"3.0.1","info":{"title":"Swagger Petstore YAML","description":"This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters","termsOfService":"http://swagger.io/terms/","contact":{"email":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"version":"1.0.1"},"externalDocs":{"description":"Find out more about Swagger","url":"http://swagger.io"},"servers":[{"url":"/api/v3"}],"tags":[{"name":"pet","description":"Everything about your Pets","externalDocs":{"description":"Find out more","url":"http://swagger.io"}},{"name":"store","description":"Operations about user"},{"name":"user","description":"Access to Petstore orders","externalDocs":{"description":"Find out more about our store","url":"http://swagger.io"}}],"paths":{"/pet":{"put":{"tags":["pet"],"summary":"Update an existing pet"
@frantuma
frantuma / malicious.yaml
Created January 23, 2019 16:33
swagger-parser PR #972
&id001
*id001: poop
r: &id200
a:
a: &id198
a: &id196
a: &id194
a: &id192
a: &id190
a: &id188
openapi: '3.0.0'
info:
description: 'ABC Service'
version: 1.0.0
title: 'ABC Service'
contact:
email: abc@abc.com
servers:
{
"swagger": "2.0",
"info": {
"description": "Data Control Structure (DCS) Api provides concept related services",
"version": "1.0",
"title": "Data Control Structure (DCS) Api"
},
"basePath": "/dcs/api",
"paths": {
"/concept/{conceptType}/{settingType}/setting": {