Skip to content

Commit

Permalink
Merge pull request #312 from IATI/develop
Browse files Browse the repository at this point in the history
Develop to main for v1.0.9 for flattening misalignment fix
  • Loading branch information
akmiller01 authored Apr 11, 2023
2 parents f85b9ba + cdb98b4 commit 5a41484
Show file tree
Hide file tree
Showing 7 changed files with 2,144 additions and 1,063 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/develop-func-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3.5.0
- uses: fastify/github-action-merge-dependabot@v3.6.3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions"
"ms-azuretools.vscode-azurefunctions",
"42crunch.vscode-openapi"
]
}
}
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,35 @@ This service follows the convention of reducing Activity documents down to a sin

The naming convention for both is to swap hyphens for underscores in tag names, and then join elements to both their children and to their attributes by an underscore. So,

<parent att="val1">
<child att="val2">
Text Value
</child>
</parent>
```xml
<iati-activities version="2.03">
<iati-activity att="val1">
<parent att="val2">
<child att="val3">
Text Value
</child>
</parent>
</iati-activity>
</iati-activities>
```

Would be flattened to the following:

```json
[
{
"parent_att": "val1",
"dataset_version": "2.03",
"att": "val1",
"parent_att": "val2",
"parent_child": "Text Value",
"parent_child_att": "val2"
"parent_child_att": "val3"
}
]
```

## Endpoints

See OpenAPI specification `postman/schemas/index.yaml`. To view locally in Swagger UI, you can use the `42crunch.vscode-openapi` VSCode extension.

## Prerequisities

Expand Down Expand Up @@ -83,12 +99,6 @@ let myEnvVariable = config.ENV_VAR
- This is done with eslint following the airbnb-base style and using [Prettier](https://prettier.io). Implemented with [this](https://sourcelevel.io/blog/how-to-setup-eslint-and-prettier-on-node) guide.
- If you use VSCode the formatting will happen automagically on save due to the `.vscode/settings.json` > `"editor.formatOnSave": true` setting

## Endpoints /api

### pvt-flatten-iati-document `POST /api/pvt/flatten/activities`

Takes a valid iati-activities XML document as the body and returns a json array of those activities flattened into json objects that can be added to the Solr Activity collection.

## Creating a new route

`func new --name <routename> --template "HTTP trigger" --authlevel "anonymous"`
Expand Down
Loading

0 comments on commit 5a41484

Please sign in to comment.