Skip to content
Snippets Groups Projects
Commit c56c078a authored by Jueun Park's avatar Jueun Park
Browse files

api examples generated, parsed and composed

parent e6d6bae7
No related branches found
No related tags found
No related merge requests found
Showing
with 464 additions and 445 deletions
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
{ {
"openapi" : "3.0.1", "openapi" : "3.0.0",
"info" : { "info" : {
"contact" : { "description" : "",
"email" : "developer@uspto.gov",
"name" : "Open Data Portal",
"url" : "https://developer.uspto.gov"
},
"description" : "The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters.",
"termsOfService" : "", "termsOfService" : "",
"title" : "USPTO Data Set API", "title" : "Simple API overview",
"version" : "1.0.0" "version" : "2.0.0"
}, },
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : { "paths" : {
"/{dataset}/{version}/records" : { "/v2" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"post" : { "get" : {
"tags" : [ "search" ], "summary" : "Show API version details",
"summary" : "Provides search capability for the data set with the given search criteria.",
"description" : "This API is based on Solr/Lucene Search. The data is indexed using SOLR. This GET API returns the list of all the searchable field names that are in the Solr Index. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the Solr/Lucene Syntax. Please refer https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for the query syntax. List of field names that are searchable can be determined using above GET api.",
"operationId" : "perform-search",
"parameters" : [ {
"description" : "Version of the dataset.",
"required" : true,
"in" : "path",
"name" : "version"
}, {
"description" : "Name of the dataset. In this case, the default value is oa_citations",
"required" : true,
"in" : "path",
"name" : "dataset"
} ],
"requestBody" : {
"description" : "", "description" : "",
"content" : { "operationId" : "getVersionDetailsv2",
"application/x-www-form-urlencoded" : { }
}
},
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "successful operation", "description" : "200 response",
"content" : { "content" : {
"application/json" : { } "application/json" : {
"examples" : {
"foo" : {
"summary" : "",
"description" : "",
"value" : {
"version" : {
"status" : "CURRENT",
"updated" : "2011-01-21T11:33:21Z",
"media-types" : [ {
"base" : "application/xml",
"type" : "application/vnd.openstack.compute+xml;version=2"
}, {
"base" : "application/json",
"type" : "application/vnd.openstack.compute+json;version=2"
} ],
"id" : "v2.0",
"links" : [ {
"href" : "http://127.0.0.1:8774/v2/",
"rel" : "self"
}, {
"href" : "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
"type" : "application/pdf",
"rel" : "describedby"
}, {
"href" : "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type" : "application/vnd.sun.wadl+xml",
"rel" : "describedby"
}, {
"href" : "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type" : "application/vnd.sun.wadl+xml",
"rel" : "describedby"
} ]
} }
}, },
"404" : { "externalValue" : ""
"description" : "No matching record found for the given criteria." }
} }
} }
} }
}, },
"/{dataset}/{version}/fields" : { "203" : {
"description" : "", "description" : "203 response",
"content" : {
"application/json" : {
"examples" : {
"foo" : {
"summary" : "", "summary" : "",
"get" : { "description" : "",
"tags" : [ "metadata" ], "value" : {
"summary" : "Provides the general information about the API and the list of fields that can be used to query the dataset.", "version" : {
"description" : "This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below.", "status" : "CURRENT",
"operationId" : "list-searchable-fields", "updated" : "2011-01-21T11:33:21Z",
"parameters" : [ { "media-types" : [ {
"description" : "Name of the dataset.", "base" : "application/xml",
"example" : "oa_citations", "type" : "application/vnd.openstack.compute+xml;version=2"
"required" : true,
"in" : "path",
"name" : "dataset"
}, { }, {
"description" : "Version of the dataset.", "base" : "application/json",
"example" : "v1", "type" : "application/vnd.openstack.compute+json;version=2"
"required" : true,
"in" : "path",
"name" : "version"
} ], } ],
"responses" : { "id" : "v2.0",
"200" : { "links" : [ {
"description" : "The dataset API for the given version is found and it is accessible to consume.", "href" : "http://23.253.228.211:8774/v2/",
"content" : { "rel" : "self"
"application/json" : { } }, {
"href" : "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
"type" : "application/pdf",
"rel" : "describedby"
}, {
"href" : "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type" : "application/vnd.sun.wadl+xml",
"rel" : "describedby"
} ]
} }
}, },
"404" : { "externalValue" : ""
"description" : "The combination of dataset name and version is not found in the system or it is not published yet to be consumed by public.", }
"content" : { }
"application/json" : { } }
} }
} }
} }
...@@ -98,28 +106,55 @@ ...@@ -98,28 +106,55 @@
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"get" : { "get" : {
"tags" : [ "metadata" ], "summary" : "List API versions",
"summary" : "List available data sets",
"description" : "", "description" : "",
"operationId" : "list-data-sets", "operationId" : "listVersionsv2",
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "Returns a list of data sets", "description" : "200 response",
"content" : { "content" : {
"application/json" : { "application/json" : {
"example" : { "examples" : {
"total" : 2, "foo" : {
"apis" : [ { "summary" : "",
"apiKey" : "oa_citations", "description" : "",
"apiVersionNumber" : "v1", "value" : {
"apiUrl" : "https://developer.uspto.gov/ds-api/oa_citations/v1/fields", "versions" : [ {
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json" "status" : "CURRENT",
"updated" : "2011-01-21T11:33:21Z",
"id" : "v2.0",
"links" : [ {
"href" : "http://127.0.0.1:8774/v2/",
"rel" : "self"
} ]
}, { }, {
"apiKey" : "cancer_moonshot", "status" : "EXPERIMENTAL",
"apiVersionNumber" : "v1", "updated" : "2013-07-23T11:33:21Z",
"apiUrl" : "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields", "id" : "v3.0",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json" "links" : [ {
"href" : "http://127.0.0.1:8774/v3/",
"rel" : "self"
} ]
} ] } ]
},
"externalValue" : ""
}
}
}
}
},
"300" : {
"description" : "300 response",
"content" : {
"application/json" : {
"examples" : {
"foo" : {
"summary" : "",
"description" : "",
"value" : "{\n \"versions\": [\n {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v2/\",\n \"rel\": \"self\"\n }\n ]\n },\n {\n \"status\": \"EXPERIMENTAL\",\n \"updated\": \"2013-07-23T11:33:21Z\",\n \"id\": \"v3.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v3/\",\n \"rel\": \"self\"\n }\n ]\n }\n ]\n}\n",
"externalValue" : ""
}
}
} }
} }
} }
...@@ -127,6 +162,4 @@ ...@@ -127,6 +162,4 @@
} }
} }
} }
},
"components" : { }
} }
\ No newline at end of file
{ {
"openapi" : "3.0.1", "openapi" : "3.0.0",
"info" : { "info" : {
"contact" : { "description" : "",
"email" : "developer@uspto.gov",
"name" : "Open Data Portal",
"url" : "https://developer.uspto.gov"
},
"description" : "The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters.",
"termsOfService" : "", "termsOfService" : "",
"title" : "USPTO Data Set API", "title" : "Callback Example",
"version" : "1.0.0" "version" : "1.0.0"
}, },
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : { "paths" : {
"/{dataset}/{version}/records" : { "/streams" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"post" : { "post" : {
"tags" : [ "search" ], "summary" : "",
"summary" : "Provides search capability for the data set with the given search criteria.", "description" : "subscribes a client to receive out-of-band data",
"description" : "This API is based on Solr/Lucene Search. The data is indexed using SOLR. This GET API returns the list of all the searchable field names that are in the Solr Index. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the Solr/Lucene Syntax. Please refer https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for the query syntax. List of field names that are searchable can be determined using above GET api.", "operationId" : "",
"operationId" : "perform-search",
"parameters" : [ { "parameters" : [ {
"description" : "Version of the dataset.", "description" : "the location where data will be sent. Must be network accessible\nby the source server\n",
"required" : true,
"in" : "path",
"name" : "version"
}, {
"description" : "Name of the dataset. In this case, the default value is oa_citations",
"required" : true, "required" : true,
"in" : "path", "in" : "query",
"name" : "dataset" "name" : "callbackUrl"
} ], } ],
"requestBody" : {
"description" : "",
"content" : {
"application/x-www-form-urlencoded" : { }
}
},
"responses" : { "responses" : {
"200" : { "201" : {
"description" : "successful operation", "description" : "subscription successfully created",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
},
"404" : {
"description" : "No matching record found for the given criteria."
}
}
} }
}, },
"/{dataset}/{version}/fields" : { "callbacks" : {
"onData" : {
"{$request.query.callbackUrl}/data" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"get" : { "post" : {
"tags" : [ "metadata" ], "summary" : "",
"summary" : "Provides the general information about the API and the list of fields that can be used to query the dataset.", "description" : "",
"description" : "This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below.", "operationId" : "",
"operationId" : "list-searchable-fields", "requestBody" : {
"parameters" : [ { "description" : "subscription payload",
"description" : "Name of the dataset.",
"example" : "oa_citations",
"required" : true,
"in" : "path",
"name" : "dataset"
}, {
"description" : "Version of the dataset.",
"example" : "v1",
"required" : true,
"in" : "path",
"name" : "version"
} ],
"responses" : {
"200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
}, },
"404" : { "responses" : {
"description" : "The combination of dataset name and version is not found in the system or it is not published yet to be consumed by public.", "202" : {
"content" : { "description" : "Your server implementation should return this HTTP status code\nif the data was received successfully\n"
"application/json" : { } },
} "204" : {
} "description" : "Your server should return this HTTP status code if no longer interested\nin further updates\n"
} }
} }
},
"/" : {
"description" : "",
"summary" : "",
"get" : {
"tags" : [ "metadata" ],
"summary" : "List available data sets",
"description" : "",
"operationId" : "list-data-sets",
"responses" : {
"200" : {
"description" : "Returns a list of data sets",
"content" : {
"application/json" : {
"example" : {
"total" : 2,
"apis" : [ {
"apiKey" : "oa_citations",
"apiVersionNumber" : "v1",
"apiUrl" : "https://developer.uspto.gov/ds-api/oa_citations/v1/fields",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json"
}, {
"apiKey" : "cancer_moonshot",
"apiVersionNumber" : "v1",
"apiUrl" : "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json"
} ]
} }
} }
} }
...@@ -127,6 +58,4 @@ ...@@ -127,6 +58,4 @@
} }
} }
} }
},
"components" : { }
} }
\ No newline at end of file
{ {
"openapi" : "3.0.1", "openapi" : "3.0.0",
"info" : { "info" : {
"contact" : { "description" : "",
"email" : "developer@uspto.gov",
"name" : "Open Data Portal",
"url" : "https://developer.uspto.gov"
},
"description" : "The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters.",
"termsOfService" : "", "termsOfService" : "",
"title" : "USPTO Data Set API", "title" : "Link Example",
"version" : "1.0.0" "version" : "1.0.0"
}, },
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : { "paths" : {
"/{dataset}/{version}/records" : { "/2.0/repositories/{username}" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"post" : { "get" : {
"tags" : [ "search" ], "summary" : "",
"summary" : "Provides search capability for the data set with the given search criteria.", "description" : "",
"description" : "This API is based on Solr/Lucene Search. The data is indexed using SOLR. This GET API returns the list of all the searchable field names that are in the Solr Index. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the Solr/Lucene Syntax. Please refer https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for the query syntax. List of field names that are searchable can be determined using above GET api.", "operationId" : "getRepositoriesByOwner",
"operationId" : "perform-search",
"parameters" : [ { "parameters" : [ {
"description" : "Version of the dataset.", "description" : "",
"required" : true,
"in" : "path",
"name" : "version"
}, {
"description" : "Name of the dataset. In this case, the default value is oa_citations",
"required" : true, "required" : true,
"in" : "path", "in" : "path",
"name" : "dataset" "name" : "username"
} ], } ],
"requestBody" : { "responses" : {
"description" : "", "200" : {
"description" : "repositories owned by the supplied user",
"content" : { "content" : {
"application/x-www-form-urlencoded" : { } "application/json" : { }
}
}
}
} }
}, },
"/2.0/users/{username}" : {
"description" : "",
"summary" : "",
"get" : {
"summary" : "",
"description" : "",
"operationId" : "getUserByName",
"parameters" : [ {
"description" : "",
"required" : true,
"in" : "path",
"name" : "username"
} ],
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "successful operation", "description" : "The User",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
},
"404" : {
"description" : "No matching record found for the given criteria."
} }
} }
} }
}, },
"/{dataset}/{version}/fields" : { "/2.0/repositories/{username}/{slug}/pullrequests/{pid}" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"get" : { "get" : {
"tags" : [ "metadata" ], "summary" : "",
"summary" : "Provides the general information about the API and the list of fields that can be used to query the dataset.", "description" : "",
"description" : "This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below.", "operationId" : "getPullRequestsById",
"operationId" : "list-searchable-fields",
"parameters" : [ { "parameters" : [ {
"description" : "Name of the dataset.", "description" : "",
"example" : "oa_citations",
"required" : true, "required" : true,
"in" : "path", "in" : "path",
"name" : "dataset" "name" : "username"
}, { }, {
"description" : "Version of the dataset.", "description" : "",
"example" : "v1", "required" : true,
"in" : "path",
"name" : "slug"
}, {
"description" : "",
"required" : true, "required" : true,
"in" : "path", "in" : "path",
"name" : "version" "name" : "pid"
} ], } ],
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.", "description" : "a pull request object",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
}
}
}
},
"/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge" : {
"description" : "",
"summary" : "",
"post" : {
"summary" : "",
"description" : "",
"operationId" : "mergePullRequest",
"parameters" : [ {
"description" : "",
"required" : true,
"in" : "path",
"name" : "username"
}, {
"description" : "",
"required" : true,
"in" : "path",
"name" : "slug"
}, {
"description" : "",
"required" : true,
"in" : "path",
"name" : "pid"
} ],
"responses" : {
"204" : {
"description" : "the PR was successfully merged"
}
}
}
}, },
"404" : { "/2.0/repositories/{username}/{slug}/pullrequests" : {
"description" : "The combination of dataset name and version is not found in the system or it is not published yet to be consumed by public.", "description" : "",
"summary" : "",
"get" : {
"summary" : "",
"description" : "",
"operationId" : "getPullRequestsByRepository",
"parameters" : [ {
"description" : "",
"required" : true,
"in" : "path",
"name" : "username"
}, {
"description" : "",
"required" : true,
"in" : "path",
"name" : "slug"
}, {
"description" : "",
"required" : false,
"in" : "query",
"name" : "state"
} ],
"responses" : {
"200" : {
"description" : "an array of pull request objects",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
...@@ -94,39 +149,73 @@ ...@@ -94,39 +149,73 @@
} }
} }
}, },
"/" : { "/2.0/repositories/{username}/{slug}" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"get" : { "get" : {
"tags" : [ "metadata" ], "summary" : "",
"summary" : "List available data sets", "description" : "",
"operationId" : "getRepository",
"parameters" : [ {
"description" : "", "description" : "",
"operationId" : "list-data-sets", "required" : true,
"in" : "path",
"name" : "username"
}, {
"description" : "",
"required" : true,
"in" : "path",
"name" : "slug"
} ],
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "Returns a list of data sets", "description" : "The repository",
"content" : { "content" : {
"application/json" : { "application/json" : { }
"example" : {
"total" : 2,
"apis" : [ {
"apiKey" : "oa_citations",
"apiVersionNumber" : "v1",
"apiUrl" : "https://developer.uspto.gov/ds-api/oa_citations/v1/fields",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json"
}, {
"apiKey" : "cancer_moonshot",
"apiVersionNumber" : "v1",
"apiUrl" : "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json"
} ]
} }
} }
} }
} }
} }
},
"components" : {
"links" : {
"UserRepositories" : {
"operationId" : "getRepositoriesByOwner",
"operationRef" : "",
"parameters" : {
"username" : "$response.body#/username"
},
"description" : ""
},
"UserRepository" : {
"operationId" : "getRepository",
"operationRef" : "",
"parameters" : {
"slug" : "$response.body#/slug",
"username" : "$response.body#/owner/username"
},
"description" : ""
},
"PullRequestMerge" : {
"operationId" : "mergePullRequest",
"operationRef" : "",
"parameters" : {
"pid" : "$response.body#/id",
"slug" : "$response.body#/repository/slug",
"username" : "$response.body#/author/username"
},
"description" : ""
},
"RepositoryPullRequests" : {
"operationId" : "getPullRequestsByRepository",
"operationRef" : "",
"parameters" : {
"slug" : "$response.body#/slug",
"username" : "$response.body#/owner/username"
},
"description" : ""
}
} }
} }
},
"components" : { }
} }
\ No newline at end of file
{ {
"openapi" : "3.0.1", "openapi" : "3.0.0",
"info" : { "info" : {
"contact" : { "contact" : {
"email" : "developer@uspto.gov", "email" : "apiteam@swagger.io",
"name" : "Open Data Portal", "name" : "Swagger API Team",
"url" : "https://developer.uspto.gov" "url" : "http://swagger.io"
},
"description" : "http://swagger.io/terms/",
"license" : {
"name" : "Apache 2.0",
"url" : "https://www.apache.org/licenses/LICENSE-2.0.html"
}, },
"description" : "The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters.",
"termsOfService" : "", "termsOfService" : "",
"title" : "USPTO Data Set API", "title" : "Swagger Petstore",
"version" : "1.0.0" "version" : "1.0.0"
}, },
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : { "paths" : {
"/{dataset}/{version}/records" : { "/pets/{id}" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"post" : { "get" : {
"tags" : [ "search" ], "summary" : "",
"summary" : "Provides search capability for the data set with the given search criteria.", "description" : "Returns a user based on a single ID, if the user does not have access to the pet",
"description" : "This API is based on Solr/Lucene Search. The data is indexed using SOLR. This GET API returns the list of all the searchable field names that are in the Solr Index. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the Solr/Lucene Syntax. Please refer https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for the query syntax. List of field names that are searchable can be determined using above GET api.", "operationId" : "find pet by id",
"operationId" : "perform-search",
"parameters" : [ { "parameters" : [ {
"description" : "Version of the dataset.", "description" : "ID of pet to fetch",
"required" : true, "required" : true,
"in" : "path", "in" : "path",
"name" : "version" "name" : "id"
}, {
"description" : "Name of the dataset. In this case, the default value is oa_citations",
"required" : true,
"in" : "path",
"name" : "dataset"
} ], } ],
"requestBody" : { "responses" : {
"description" : "", "200" : {
"description" : "pet response",
"content" : {
"application/json" : { }
}
},
"default" : {
"description" : "unexpected error",
"content" : { "content" : {
"application/x-www-form-urlencoded" : { } "application/json" : { }
}
}
} }
}, },
"delete" : {
"summary" : "",
"description" : "deletes a single pet based on the ID supplied",
"operationId" : "deletePet",
"parameters" : [ {
"description" : "ID of pet to delete",
"required" : true,
"in" : "path",
"name" : "id"
} ],
"responses" : { "responses" : {
"200" : { "default" : {
"description" : "successful operation", "description" : "unexpected error",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
}, },
"404" : { "204" : {
"description" : "No matching record found for the given criteria." "description" : "pet deleted"
} }
} }
} }
}, },
"/{dataset}/{version}/fields" : { "/pets" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"get" : { "get" : {
"tags" : [ "metadata" ], "summary" : "",
"summary" : "Provides the general information about the API and the list of fields that can be used to query the dataset.", "description" : "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n",
"description" : "This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below.", "operationId" : "findPets",
"operationId" : "list-searchable-fields",
"parameters" : [ { "parameters" : [ {
"description" : "Name of the dataset.", "description" : "tags to filter by",
"example" : "oa_citations", "required" : false,
"required" : true, "in" : "query",
"in" : "path", "name" : "tags"
"name" : "dataset"
}, { }, {
"description" : "Version of the dataset.", "description" : "maximum number of results to return",
"example" : "v1", "required" : false,
"required" : true, "in" : "query",
"in" : "path", "name" : "limit"
"name" : "version"
} ], } ],
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.", "description" : "pet response",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
}, },
"404" : { "default" : {
"description" : "The combination of dataset name and version is not found in the system or it is not published yet to be consumed by public.", "description" : "unexpected error",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
} }
} }
}
}, },
"/" : { "post" : {
"description" : "",
"summary" : "", "summary" : "",
"get" : { "description" : "Creates a new pet in the store. Duplicates are allowed",
"tags" : [ "metadata" ], "operationId" : "addPet",
"summary" : "List available data sets", "requestBody" : {
"description" : "", "description" : "Pet to add to the store",
"operationId" : "list-data-sets", "required" : true,
"content" : {
"application/json" : { }
}
},
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "Returns a list of data sets", "description" : "pet response",
"content" : { "content" : {
"application/json" : { "application/json" : { }
"example" : {
"total" : 2,
"apis" : [ {
"apiKey" : "oa_citations",
"apiVersionNumber" : "v1",
"apiUrl" : "https://developer.uspto.gov/ds-api/oa_citations/v1/fields",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json"
}, {
"apiKey" : "cancer_moonshot",
"apiVersionNumber" : "v1",
"apiUrl" : "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json"
} ]
}
} }
},
"default" : {
"description" : "unexpected error",
"content" : {
"application/json" : { }
} }
} }
} }
......
{ {
"openapi" : "3.0.1", "openapi" : "3.0.0",
"info" : { "info" : {
"contact" : { "description" : "",
"email" : "developer@uspto.gov", "license" : {
"name" : "Open Data Portal", "name" : "MIT",
"url" : "https://developer.uspto.gov" "url" : ""
}, },
"description" : "The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters.",
"termsOfService" : "", "termsOfService" : "",
"title" : "USPTO Data Set API", "title" : "Swagger Petstore",
"version" : "1.0.0" "version" : "1.0.0"
}, },
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : { "paths" : {
"/{dataset}/{version}/records" : { "/pets" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"post" : { "get" : {
"tags" : [ "search" ], "tags" : [ "pets" ],
"summary" : "Provides search capability for the data set with the given search criteria.", "summary" : "List all pets",
"description" : "This API is based on Solr/Lucene Search. The data is indexed using SOLR. This GET API returns the list of all the searchable field names that are in the Solr Index. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the Solr/Lucene Syntax. Please refer https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for the query syntax. List of field names that are searchable can be determined using above GET api.", "description" : "",
"operationId" : "perform-search", "operationId" : "listPets",
"parameters" : [ { "parameters" : [ {
"description" : "Version of the dataset.", "description" : "How many items to return at one time (max 100)",
"required" : true, "required" : false,
"in" : "path", "in" : "query",
"name" : "version" "name" : "limit"
}, {
"description" : "Name of the dataset. In this case, the default value is oa_citations",
"required" : true,
"in" : "path",
"name" : "dataset"
} ], } ],
"requestBody" : {
"description" : "",
"content" : {
"application/x-www-form-urlencoded" : { }
}
},
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "successful operation", "description" : "A paged array of pets",
"headers" : {
"x-next" : {
"description" : "A link to the next page of responses",
"required" : false,
"style" : ""
}
},
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
}, },
"404" : { "default" : {
"description" : "No matching record found for the given criteria." "description" : "unexpected error",
"content" : {
"application/json" : { }
} }
} }
} }
}, },
"/{dataset}/{version}/fields" : { "post" : {
"tags" : [ "pets" ],
"summary" : "Create a pet",
"description" : "", "description" : "",
"summary" : "", "operationId" : "createPets",
"get" : {
"tags" : [ "metadata" ],
"summary" : "Provides the general information about the API and the list of fields that can be used to query the dataset.",
"description" : "This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below.",
"operationId" : "list-searchable-fields",
"parameters" : [ {
"description" : "Name of the dataset.",
"example" : "oa_citations",
"required" : true,
"in" : "path",
"name" : "dataset"
}, {
"description" : "Version of the dataset.",
"example" : "v1",
"required" : true,
"in" : "path",
"name" : "version"
} ],
"responses" : { "responses" : {
"200" : { "default" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.", "description" : "unexpected error",
"content" : { "content" : {
"application/json" : { } "application/json" : { }
} }
}, },
"404" : { "201" : {
"description" : "The combination of dataset name and version is not found in the system or it is not published yet to be consumed by public.", "description" : "Null response"
"content" : {
"application/json" : { }
}
} }
} }
} }
}, },
"/" : { "/pets/{petId}" : {
"description" : "", "description" : "",
"summary" : "", "summary" : "",
"get" : { "get" : {
"tags" : [ "metadata" ], "tags" : [ "pets" ],
"summary" : "List available data sets", "summary" : "Info for a specific pet",
"description" : "", "description" : "",
"operationId" : "list-data-sets", "operationId" : "showPetById",
"parameters" : [ {
"description" : "The id of the pet to retrieve",
"required" : true,
"in" : "path",
"name" : "petId"
} ],
"responses" : { "responses" : {
"200" : { "200" : {
"description" : "Returns a list of data sets", "description" : "Expected response to a valid request",
"content" : { "content" : {
"application/json" : { "application/json" : { }
"example" : {
"total" : 2,
"apis" : [ {
"apiKey" : "oa_citations",
"apiVersionNumber" : "v1",
"apiUrl" : "https://developer.uspto.gov/ds-api/oa_citations/v1/fields",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json"
}, {
"apiKey" : "cancer_moonshot",
"apiVersionNumber" : "v1",
"apiUrl" : "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields",
"apiDocumentationUrl" : "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json"
} ]
}
} }
},
"default" : {
"description" : "unexpected error",
"content" : {
"application/json" : { }
} }
} }
} }
......
...@@ -33,8 +33,8 @@ public class OpenAPIMain { ...@@ -33,8 +33,8 @@ public class OpenAPIMain {
public static void main(String[] args) throws IOException, ResolutionException, ValidationException, EncodeException { public static void main(String[] args) throws IOException, ResolutionException, ValidationException, EncodeException {
OpenAPIObject openApi; OpenAPIObject openApi;
OpenApi3 api3; OpenApi3 api3;
String fileName = "uspto.json"; String fileName = "petstore-expanded.json";
FileWriter writer = new FileWriter("./gen-api-ex/api-with-examples_generated.json"); FileWriter writer = new FileWriter("./gen-api-ex/petstore-expanded_generated.json");
URL expUrl = OpenAPIMain.class.getClassLoader().getResource(fileName); URL expUrl = OpenAPIMain.class.getClassLoader().getResource(fileName);
File file = null; File file = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment