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

add id in GET /metadata.jsonld responses #279

Conversation

longshuicy
Copy link
Member

@longshuicy longshuicy commented Sep 24, 2021

Description

add id field in response of :

GET /api/datasets/{id}/metadata.jsonld
GET /api/files/{id}/metadata.jsonld

GET /api/files/metadata.jsonld?id=xxx&id=xxx

Now you should see an id field in the return
e.g.

{
        "@context": [
            "https://clowderframework.org/contexts/metadata.jsonld",
            {
                "Funding Institution": "http://sead-data.net/terms/FundingInstitution"
            }
        ],
        "attached_to": {
            "resource_type": "cat:file",
            "url": "http://localhost:9000/files/6101852f19ec54b93cb07ff1"
        },
        "created_at": "Fri Sep 24 16:39:36 CDT 2021",
        "agent": {
            "@type": "cat:user",
            "name": "Chen Wang",
            "user_id": "http://localhost:9000/api/users/610183f740d74ef84576680d"
        },
        "content": {
            "Funding Institution": "ncsa"
        },
        "id": "614e459819ec1c778a5ffd7b"
    },

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the CHANGELOG.md.
  • I have signed the CLA
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@bodom0015 bodom0015 left a comment

Choose a reason for hiding this comment

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

Works as advertised 👍 LGTM

It's a bit strange to see the ID at the end, but certainly better than seeing no ID at all :)

app/util/JSONLD.scala Outdated Show resolved Hide resolved
@lmarini lmarini merged commit 3c5eddc into develop Oct 1, 2021
@robkooper robkooper deleted the 278-Add-metadata-id-in-response-when-GET-metadata-from-dataset-and-file branch September 10, 2022 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants