Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from lifemapper/open_tree_update
Browse files Browse the repository at this point in the history
Open tree update
  • Loading branch information
cjgrady authored Oct 26, 2021
2 parents 0f8ce33 + 9514146 commit 0ced60c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions source/Encoder.elm
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ encodeBiotaphyPointsPost (BiotaphyPointsPost taxonIds) =


encodeOpenTreePOST : OpenTreePOST -> Value
encodeOpenTreePOST (OpenTreePOST taxonIds) =
taxonIds |> List.map int |> list
encodeOpenTreePOST (OpenTreePOST taxonNames) =
taxonNames |> List.map string |> list


encodeOccurrenceMetadata : OccurrenceMetadata -> Value
Expand Down
2 changes: 1 addition & 1 deletion source/OccurrenceFromTaxonomy.elm
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ requestTree flags matches =
, url = flags.apiRoot ++ "opentree"
, body =
matches
|> List.filterMap (\(TaxonomyListItem { taxon_key }) -> String.toInt taxon_key |> Result.toMaybe)
|> List.map (\(TaxonomyListItem { scientific_name }) -> scientific_name)
|> Decoder.OpenTreePOST
|> Encoder.encodeOpenTreePOST
|> Http.jsonBody
Expand Down
2 changes: 1 addition & 1 deletion source/OccurrenceSetTaxonList.elm
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ requestTree flags matches =
, url = flags.apiRoot ++ "opentree"
, body =
matches
|> List.filterMap .taxonId
|> List.filterMap .acceptedName
|> Decoder.OpenTreePOST
|> Encoder.encodeOpenTreePOST
|> Http.jsonBody
Expand Down
5 changes: 2 additions & 3 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
},
"host": "svc.lifemapper.org",
"schemes": [
"http",
"https"
],
"basePath": "/api/v2",
Expand Down Expand Up @@ -1567,7 +1566,7 @@
{
"name": "body",
"in": "body",
"description": "A list of GBIF Taxon IDs to get a tree for",
"description": "A list of GBIF taxon names to get a tree for",
"required": true,
"schema": {
"$ref": "#/definitions/OpenTreePOST"
Expand Down Expand Up @@ -3254,7 +3253,7 @@
"OpenTreePOST": {
"type": "array",
"items": {
"type": "integer"
"type": "string"
}
},
"OpenTreePOSTresponse": {
Expand Down

0 comments on commit 0ced60c

Please sign in to comment.