fix: warn when observable mimeType is image/jpg - #96
Open
forest-savage1234 wants to merge 1 commit into
Open
Conversation
Closes casework#50. image/jpg is not an IANA media type (RFC 2046 / IANA registry use image/jpeg). ContentDataFacet and FileFacet emit UserWarning when the mime argument is exactly that string, and still store the value. Out of scope: Mapping-Python casework#43 / casework#18, coercing to image/jpeg, a general media-type validator, a CASE/UCO 1.5.0 pin, UCO #363, dropping or rewriting Bundle. Identity if committed: Forest Savage <forestsavage03@gmail.com> Do not push from this packet.
Author
|
Thank you for the time on this review. This only warns when an observable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warn when observable:mimeType is image/jpg
Closes #50.
Repo rules (casework/CASE-Mapping-Python): no CONTRIBUTING, no PR template. Open against
main. CI is.github/workflows/ci.yml. Boxes match commands actually run on this box afterPATCH.diff.pre-commit run --all-filespoetry run mypy case_mapping example.py testspoetry run pytest --doctest-modulespoetry run python example.pyDo not drop Bundle. Do not reopen UCO #363.
Summary
image/jpgis a typo (IANA Media Types registry; RFC 2046 usesimage/jpeg). Alex asked whetherwarnings.warnshould fire when that string is used.ContentDataFacetandFileFacet(the live class; there is noFacetFile) nowwarn(..., UserWarning)when the mime argument is exactlyimage/jpg. The value is still stored. No ontology change. UCO #363 is not reopened.Validation
Shallow clone of casework/CASE-Mapping-Python
main@ea0ee6645ba10135e3c4232e79fb8bbb5e34f50c(2026-07-20 5:36am AKDT) in/workspace/checkouts/CASE-Mapping-Python.PATCH.diffapplied (patch -p1). Identity for any later commit: Forest Savage forestsavage03@gmail.com. Nothing posted. Ran on Python 3.13.5 / Poetry 2.4.1 (CI matrix is 3.10 and 3.14; those were not on this box).Exit 0.
Exit 0.
Exit 0.
Exit 0. Wrote 80844 bytes to stdout (same size as committed
case.jsonld).Review snippet (not a CI box):
ContentDataFacet/FileFacetwithimage/jpegproduced 0 warnings;image/jpgproduced 2UserWarnings (observable:mimeType 'image/jpg' is not an IANA media type; use 'image/jpeg'.).class Bundleremains atcase_mapping/uco/core.py:65.Files
case_mapping/uco/observable.py(ContentDataFacet.__init__,FileFacet.__init__)Out of scope
image/jpg→image/jpegBundleHow to review
warnwas already imported in this file (used byOperatingSystemFacet).Volunteer stand-down
I am a volunteer. If warn-on-construct is the wrong layer, or if you wanted a hard error instead, I will stand down.
I am a volunteer. Thank you for the time. I am trying to become more useful on this work, so I welcome a critical look. If this is the wrong cut, or you want me to stand down, say so and I will recut from notes.
If a warning is the wrong tool, say so and I will stand down.