From bdae467e6cbf0819782d50ed3e453ad7b9cfd896 Mon Sep 17 00:00:00 2001 From: Dmitry Mozzherin Date: Wed, 24 Aug 2022 08:44:42 -0500 Subject: [PATCH] prepare v1.0.0 (close #127) --- CHANGELOG.md | 3 +++ README.md | 11 ++--------- config/config.go | 6 +++--- gnfinder/cmd/gnfinder.yml | 2 +- io/web/server.go | 8 ++++---- io/web/templates/apidoc.html | 8 ++++---- version.go | 2 +- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5687687..928866e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +## [v1.0.0] 2022-08-24 Wed + +- Add [#127]: prepare v1.0.0. - Add: Nix build and shell files. - Add: rename dictionaries. diff --git a/README.md b/README.md index e118792..6e6df67 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,6 @@ connection. * [Usage of API](#usage-of-api) * [Projects based on GNfinder](#projects-based-on-gnfinder) * [Development](#development) - * [Modify OpenAPI documentation](#modify-openapi-documentation) * [Testing](#testing) @@ -359,13 +358,13 @@ If you want to start your own API endpoint (for example on `localhost`, port ```bash gnfinder -p 8080 -curl localhost:8080/api/v0/ping +curl localhost:8080/api/v1/ping ``` To upload a file and detect names from its content: ```bash -curl -v -F verification=true -F file=@/path/to/test.txt https://gnfinder.globalnames.org/api/v0/find +curl -v -F verification=true -F file=@/path/to/test.txt https://gnfinder.globalnames.org/api/v1/find ``` ## Projects based on GNfinder @@ -390,12 +389,6 @@ make tools make install ``` -### Modify OpenAPI documentation - -```bash -docker run -d -p 80:8080 swaggerapi/swagger-editor -``` - ## Testing From the root of the project: diff --git a/config/config.go b/config/config.go index bb6bc4d..6de231b 100644 --- a/config/config.go +++ b/config/config.go @@ -46,7 +46,7 @@ type Config struct { // DataSources is a list of data-source IDs used for the // name-verification. These data-sources will always be matched with the // verified names. You can find the list of all data-sources at - // https://verifier.globalnames.org/api/v0/data_sources + // https://verifier.globalnames.org/api/v1/data_sources DataSources []int // TikaURL contains the URL of Apache Tika service. This service is used @@ -257,9 +257,9 @@ func New(opts ...Option) Config { WithBayes: true, BayesOddsThreshold: 80.0, TokensAround: 0, - VerifierURL: "https://verifier.globalnames.org/api/v0/", + VerifierURL: "https://verifier.globalnames.org/api/v1/", TikaURL: "https://tika.globalnames.org", - APIDoc: "https://apidoc.globalnames.org/gnfinder-beta", + APIDoc: "https://apidoc.globalnames.org/gnfinder", } for _, opt := range opts { diff --git a/gnfinder/cmd/gnfinder.yml b/gnfinder/cmd/gnfinder.yml index e503f53..c2025aa 100644 --- a/gnfinder/cmd/gnfinder.yml +++ b/gnfinder/cmd/gnfinder.yml @@ -60,7 +60,7 @@ # VerifierURL contains the URL of a name-verification service. # -# VerifierURL: https://verifier.globalnames.org/api/v0/ +# VerifierURL: https://verifier.globalnames.org/api/v1/ # WithAllMatches sets verification to return all found matches. # diff --git a/io/web/server.go b/io/web/server.go index 9b9fbc3..572bb51 100644 --- a/io/web/server.go +++ b/io/web/server.go @@ -39,10 +39,10 @@ func Run(gnf gnfinder.GNfinder, port int) { e.POST("/find", find(gnf)) e.GET("/api", infoAPI(gnf)) - e.GET("/api/v0", infoAPI(gnf)) - e.GET("/api/v0/ping", pingAPI()) - e.GET("/api/v0/version", verAPI(gnf)) - e.POST("/api/v0/find", findAPI(gnf)) + e.GET("/api/v1", infoAPI(gnf)) + e.GET("/api/v1/ping", pingAPI()) + e.GET("/api/v1/version", verAPI(gnf)) + e.POST("/api/v1/find", findAPI(gnf)) fs := http.FileServer(http.FS(static)) e.GET("/static/*", echo.WrapHandler(fs)) diff --git a/io/web/templates/apidoc.html b/io/web/templates/apidoc.html index a582a97..3599d09 100644 --- a/io/web/templates/apidoc.html +++ b/io/web/templates/apidoc.html @@ -10,13 +10,13 @@

Application Programming Interface (API)

- Web-based scientific names finding service provides a RESTful + Web-based scientific names finding service provides a RESTful API interface.

Using POST Method with JSON payload

-
/api/v0
+
/api/v1

with request body in JSON according to the @@ -32,14 +32,14 @@

Using POST Method to Upload Files

against Catalogue of Life - (source #1) and + (source #1) and Encyclopedia of Life (source #12):

curl -v -F sources[]=1 -F sources[]=12 -F file=@file.pdf \
-    https://finder.globalnames.org/api/v0/find
+ https://finder.globalnames.org/api/v1/find

For examples how to write a client, refer to diff --git a/version.go b/version.go index 8ab4c79..399e10d 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,6 @@ package gnfinder var ( - Version = "v0.19.5+" + Version = "v1.0.0+" Build string )