Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add optional --fix-content-type TDE-859 #655

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

paulfouquet
Copy link
Collaborator

Description

Add an option --fix-content-type in format-json (previously pretty-print) to force the content-type to be updated for json s3 objects.

Intention

Some of the STAC files (Item) have a content-type set to application/json instead of application/geo+json.

Checklist

If not applicable, provide explanation of why.

  • Tests updated: no tests for aws objects
  • Docs updated
  • Issue linked in Title

Co-authored-by: Alice Fage <afage@linz.govt.nz>
amfage
amfage previously approved these changes Sep 14, 2023
README.md Outdated

#### Example

- Format and overwrite files:

```bash
pretty-print source/
format-json source/ [--fix-content-type]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the name change? prettier will format a lot more than json. eg markdown, yaml, javascript etc..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's looking for json files atm. I can make the function more generic and look at other file format but I feel it will need a bit more work, specially around the --fix-content-type

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change to rename it, so Id prefer to leave it as is if we can?


#### Example

- Format and overwrite files:

```bash
pretty-print source/
pretty-print source/ [--fix-content-type]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flag should be before the directory.

Copy link
Contributor

@l0b0 l0b0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a minor nit this looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants