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

api examples generated, parsed and composed

parent c61ccfe5
No related branches found
No related tags found
No related merge requests found
Showing
with 798 additions and 168 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.0",
"info" : {
"description" : "",
"termsOfService" : "",
"title" : "Simple API overview",
"version" : "2.0.0"
},
"paths" : {
"/v2" : {
"description" : "",
"summary" : "",
"get" : {
"summary" : "Show API version details",
"description" : "",
"operationId" : "getVersionDetailsv2",
"responses" : {
"200" : {
"description" : "200 response",
"content" : {
"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"
} ]
}
},
"externalValue" : ""
}
}
}
}
},
"203" : {
"description" : "203 response",
"content" : {
"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://23.253.228.211: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"
} ]
}
},
"externalValue" : ""
}
}
}
}
}
}
}
},
"/" : {
"description" : "",
"summary" : "",
"get" : {
"summary" : "List API versions",
"description" : "",
"operationId" : "listVersionsv2",
"responses" : {
"200" : {
"description" : "200 response",
"content" : {
"application/json" : {
"examples" : {
"foo" : {
"summary" : "",
"description" : "",
"value" : {
"versions" : [ {
"status" : "CURRENT",
"updated" : "2011-01-21T11:33:21Z",
"id" : "v2.0",
"links" : [ {
"href" : "http://127.0.0.1:8774/v2/",
"rel" : "self"
} ]
}, {
"status" : "EXPERIMENTAL",
"updated" : "2013-07-23T11:33:21Z",
"id" : "v3.0",
"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" : ""
}
}
}
}
}
}
}
}
}
}
\ No newline at end of file
{
"openapi" : "3.0.1",
"info" : {
"contact" : {
"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" : "",
"title" : "USPTO Data Set API",
"version" : "1.0.0"
},
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : {
"/{dataset}/{version}/records" : {
"description" : "",
"summary" : "",
"post" : {
"tags" : [ "search" ],
"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" : "",
"content" : {
"application/x-www-form-urlencoded" : { }
}
},
"responses" : {
"200" : {
"description" : "successful operation",
"content" : {
"application/json" : { }
}
},
"404" : {
"description" : "No matching record found for the given criteria."
}
}
}
},
"/{dataset}/{version}/fields" : {
"description" : "",
"summary" : "",
"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" : {
"200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.",
"content" : {
"application/json" : { }
}
},
"404" : {
"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" : { }
}
}
}
}
},
"/" : {
"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"
} ]
}
}
}
}
}
}
}
},
"components" : { }
}
\ No newline at end of file
{
"openapi" : "3.0.1",
"info" : {
"contact" : {
"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" : "",
"title" : "USPTO Data Set API",
"version" : "1.0.0"
},
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : {
"/{dataset}/{version}/records" : {
"description" : "",
"summary" : "",
"post" : {
"tags" : [ "search" ],
"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" : "",
"content" : {
"application/x-www-form-urlencoded" : { }
}
},
"responses" : {
"200" : {
"description" : "successful operation",
"content" : {
"application/json" : { }
}
},
"404" : {
"description" : "No matching record found for the given criteria."
}
}
}
},
"/{dataset}/{version}/fields" : {
"description" : "",
"summary" : "",
"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" : {
"200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.",
"content" : {
"application/json" : { }
}
},
"404" : {
"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" : { }
}
}
}
}
},
"/" : {
"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"
} ]
}
}
}
}
}
}
}
},
"components" : { }
}
\ No newline at end of file
{
"openapi" : "3.0.1",
"info" : {
"contact" : {
"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" : "",
"title" : "USPTO Data Set API",
"version" : "1.0.0"
},
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : {
"/{dataset}/{version}/records" : {
"description" : "",
"summary" : "",
"post" : {
"tags" : [ "search" ],
"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" : "",
"content" : {
"application/x-www-form-urlencoded" : { }
}
},
"responses" : {
"200" : {
"description" : "successful operation",
"content" : {
"application/json" : { }
}
},
"404" : {
"description" : "No matching record found for the given criteria."
}
}
}
},
"/{dataset}/{version}/fields" : {
"description" : "",
"summary" : "",
"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" : {
"200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.",
"content" : {
"application/json" : { }
}
},
"404" : {
"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" : { }
}
}
}
}
},
"/" : {
"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"
} ]
}
}
}
}
}
}
}
},
"components" : { }
}
\ No newline at end of file
{
"openapi" : "3.0.1",
"info" : {
"contact" : {
"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" : "",
"title" : "USPTO Data Set API",
"version" : "1.0.0"
},
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : {
"/{dataset}/{version}/records" : {
"description" : "",
"summary" : "",
"post" : {
"tags" : [ "search" ],
"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" : "",
"content" : {
"application/x-www-form-urlencoded" : { }
}
},
"responses" : {
"200" : {
"description" : "successful operation",
"content" : {
"application/json" : { }
}
},
"404" : {
"description" : "No matching record found for the given criteria."
}
}
}
},
"/{dataset}/{version}/fields" : {
"description" : "",
"summary" : "",
"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" : {
"200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.",
"content" : {
"application/json" : { }
}
},
"404" : {
"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" : { }
}
}
}
}
},
"/" : {
"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"
} ]
}
}
}
}
}
}
}
},
"components" : { }
}
\ No newline at end of file
{
"openapi" : "3.0.1",
"info" : {
"contact" : {
"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" : "",
"title" : "USPTO Data Set API",
"version" : "1.0.0"
},
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : {
"/{dataset}/{version}/records" : {
"description" : "",
"summary" : "",
"post" : {
"tags" : [ "search" ],
"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" : "",
"content" : {
"application/x-www-form-urlencoded" : { }
}
},
"responses" : {
"200" : {
"description" : "successful operation",
"content" : {
"application/json" : { }
}
},
"404" : {
"description" : "No matching record found for the given criteria."
}
}
}
},
"/{dataset}/{version}/fields" : {
"description" : "",
"summary" : "",
"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" : {
"200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.",
"content" : {
"application/json" : { }
}
},
"404" : {
"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" : { }
}
}
}
}
},
"/" : {
"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"
} ]
}
}
}
}
}
}
}
},
"components" : { }
}
\ No newline at end of file
{
"openapi" : "3.0.1",
"info" : {
"contact" : {
"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" : "",
"title" : "USPTO Data Set API",
"version" : "1.0.0"
},
"tags" : [ {
"name" : "metadata",
"description" : "Find out about the data sets"
}, {
"name" : "search",
"description" : "Search a data set"
} ],
"paths" : {
"/{dataset}/{version}/records" : {
"description" : "",
"summary" : "",
"post" : {
"tags" : [ "search" ],
"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" : "",
"content" : {
"application/x-www-form-urlencoded" : { }
}
},
"responses" : {
"200" : {
"description" : "successful operation",
"content" : {
"application/json" : { }
}
},
"404" : {
"description" : "No matching record found for the given criteria."
}
}
}
},
"/{dataset}/{version}/fields" : {
"description" : "",
"summary" : "",
"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" : {
"200" : {
"description" : "The dataset API for the given version is found and it is accessible to consume.",
"content" : {
"application/json" : { }
}
},
"404" : {
"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" : { }
}
}
}
}
},
"/" : {
"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"
} ]
}
}
}
}
}
}
}
},
"components" : { }
}
\ No newline at end of file
...@@ -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 = "api-with-examples.json"; String fileName = "uspto.json";
FileWriter writer = new FileWriter("composedFile.json"); FileWriter writer = new FileWriter("./gen-api-ex/api-with-examples_generated.json");
URL expUrl = OpenAPIMain.class.getClassLoader().getResource(fileName); URL expUrl = OpenAPIMain.class.getClassLoader().getResource(fileName);
File file = null; File file = null;
...@@ -671,6 +671,9 @@ public class OpenAPIMain { ...@@ -671,6 +671,9 @@ public class OpenAPIMain {
parameterObject.setName(parameter.getName()); parameterObject.setName(parameter.getName());
parameterObject.setIn(parameter.getIn()); parameterObject.setIn(parameter.getIn());
if( parameter.getRequired() == null )
parameterObject.setRequired(false);
else
parameterObject.setRequired(parameter.getRequired()); parameterObject.setRequired(parameter.getRequired());
if( parameter.getDescription() != null ) if( parameter.getDescription() != null )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment