diff --git a/data-wrapper/examples.http b/data-wrapper/examples.http index 824d668..95138bd 100644 --- a/data-wrapper/examples.http +++ b/data-wrapper/examples.http @@ -1,6 +1,6 @@ # File Global Variables: Variables defined in Region without name or request -#@baseUrl = http://localhost:31976 -@baseUrl = http://data-wrapper-2.tdmservices.intra.inist.fr/ +@baseUrl = http://localhost:31976 +#@baseUrl = http://data-wrapper-2.tdmservices.intra.inist.fr/ ### # @name csv @@ -15,6 +15,17 @@ Last Action Hero,1993,John,McTierman,Arnold Schwarzenegger/Austin O'Brien/Charles Dance/Bridget Wilson-Sampras,"6,2",http://www.imdb.com/title/tt0107362/ ### +# @name fields/csv +POST {{baseUrl}}/v1/fields/csv HTTP/1.1 +Content-Type: text/csv + +title,year,director/firstNane,director/LastNane,actors,rating,imdb +Rocky,1976,John G.,Avildsen,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young,"8,1",http://www.imdb.com/title/tt0075148/ +Rocky 2,1979,Sylvester,Stallone,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young/Burgess Meredith/Tony Burton/Frank Stallone/Stu Nahan,"7,2",http://www.imdb.com/title/tt0079817/ +Rocky 3,1982,Sylvester,Stallone,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young/Burgess Meredith/Mister T./Hulk Hogan/Tony Burton,"6,7",http://www.imdb.com/title/tt0084602/ +Last Action Hero,1993,John,McTierman,Arnold Schwarzenegger/Austin O'Brien/Charles Dance/Bridget Wilson-Sampras,"6,2",http://www.imdb.com/title/tt0107362/ + +### # @name tarTei2json # @save # @extension tar.gz diff --git a/data-wrapper/v1/fields/csv.ini b/data-wrapper/v1/fields/csv.ini new file mode 100644 index 0000000..e77bb93 --- /dev/null +++ b/data-wrapper/v1/fields/csv.ini @@ -0,0 +1,42 @@ +# Entrypoint output format +mimeType = application/json +extension = json + +# OpenAPI Documentation - JSON format (dot notation) +post.operationId = post-v1-fields-csv +post.description = Liste des colonnes d'un fichier CSV +post.summary = Le fichier est analysé pour lister les colonnes utilisées +post.tags.0 = data-wrapper +post.requestBody.content.text/csv.schema.type = string +post.requestBody.content.text/csv.schema.format = binary +post.requestBody.required = true +post.responses.default.description = Liste d'objets +post.requestBody.content.application/json.example.0.value = Title +post.requestBody.content.application/json.example.1.value = Keywords +post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.requestBody.required = true +post.parameters.0.description = Indenter le JSON résultant +post.parameters.0.in = query +post.parameters.0.name = indent +post.parameters.0.schema.type = boolean + +[use] +plugin = basics + +[CSVParse] + +[CSVObject] + +[shift] + +[exchange] +value = self().keys() + +[ungroup] + +[replace] +path = value +value = self() + +[dump] +indent = env('indent', false)