Skip to content

Commit

Permalink
Disable reshape and remove ability to alter [elifesciences/enhanced-p…
Browse files Browse the repository at this point in the history
  • Loading branch information
nlisgo committed Oct 4, 2024
1 parent eaa46a5 commit 22cce9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ docker compose up
cat [LOCATION OF JATS XML] | curl -X POST --data @- http://localhost:3000/
```

## Convert JATS to json with api (disable reshape)

```bash
cat [LOCATION OF JATS XML] | curl -X POST --data @- "http://localhost:3000/?reshape=false"
```

## Convert JATS to json with api target a specific encoda version

```bash
Expand Down
10 changes: 3 additions & 7 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,15 @@ app.post('/', async (req, res) => {
const xmlFile = `${tempOutput}/article.xml`;
writeFileSync(xmlFile, xmlData);

const shouldReshape = req.query.reshape !== 'false';

const parameters = {
from: 'jats',
to: 'json',
encodeOptions: {
isBundle: false,
},
...!shouldReshape ? {
decodeOptions: {
shouldReshape,
},
} : {},
decodeOptions: {
shouldReshape: false,
},
};

const replacementPath = typeof req.query.replacementPath === 'string' ? req.query.replacementPath : '';
Expand Down

0 comments on commit 22cce9b

Please sign in to comment.