Skip to content

32 oedp javascript library to generate data passport from the data passports json schema#34

Open
gadhalekshmip wants to merge 4 commits intomainfrom
32-oedp-javascript-library-to-generate-data-passport-from-the-data-passports-json-schema
Open

32 oedp javascript library to generate data passport from the data passports json schema#34
gadhalekshmip wants to merge 4 commits intomainfrom
32-oedp-javascript-library-to-generate-data-passport-from-the-data-passports-json-schema

Conversation

@gadhalekshmip
Copy link
Collaborator

This update includes a feature that allows the code to fetch JSON schemas from specific URLs. It successfully retrieves schemas from certain sources, such as OpenEthics GitHub links like:
https://github.com/OpenEthicsAI/OEDP/blob/main/schema/oedp.annotation.schema.json.

Please review and provide feedback. Let me know if further modifications are needed. Thank you!

@nikiluk
Copy link
Collaborator

nikiluk commented Mar 2, 2025

Hi @gadhalekshmip thanks a lot, here are my notes.

  • readme file is empty, I think something was not saved and the empty readme was committed.
  • the submission of the URL https://openethics.ai/schema/oedp/oedp.passport.schema.json of the form did not work and returned the CORS error. To fix the CORS error on local testing I suggest to use libraries that allow to bypass CORS issues. Or perhaps you'd have other suggestions on launching the code?
  • I tried to submit the root-level JSON schema manually. Upon testing I see that the JSON schema is not implemented recurrently to build the form and because of that, all the references for the JSON schemas are not rendered. This is the most important part of the feedback because it essentially does not allow to complete or to submit the valid OEDP
    2025-03-02 2519x1277 4EYb7

@nikiluk nikiluk closed this Mar 2, 2025
@nikiluk
Copy link
Collaborator

nikiluk commented Mar 2, 2025

What is great is that you've realized the submission of the form and implemented 2 different ways to get the submissions - in CSV and JSON

2025-03-02 355x209 GmFlu

@nikiluk
Copy link
Collaborator

nikiluk commented Mar 2, 2025

One more note, the JSON schema has explicit requirements listed to the field, owever the form does not seem to respect these requirements.

While JSON Schema requires me to supply date time for example as validUntil, I was still able to submit random text
Models require the list of model information, however I was able to submit not an array but random text there

  {
    "id": "4eae4038-11c3-481b-bb7e-7ccc5ef7eb8a",
    "scope": "for the dataset of the AI coaching model training",
    "created": "2025-03-02",
    "product": "coaching api",
    "updated": "2025-03-02",
    "validUntil": "jhbljsdbhasldjfbh",
    "models": "lk;noij"
  }

@nikiluk
Copy link
Collaborator

nikiluk commented Mar 2, 2025

I do confirm that raw GitHub link with JSON schema works https://raw.githubusercontent.com/OpenEthicsAI/OEDP/refs/heads/main/schema/oedp.passport.schema.json

the submission of the URL https://openethics.ai/schema/oedp/oedp.passport.schema.json is blocked by CORS, which will be typical, so instruction needed on how to overcome that (or a workaround)

@nikiluk
Copy link
Collaborator

nikiluk commented Apr 16, 2025

Hi @gadhalekshmip did you have a chace to come back to the issue and review the comments I provided earlier?

@nikiluk nikiluk reopened this Apr 16, 2025
@gadhalekshmip
Copy link
Collaborator Author

Hi @nikiluk ,
Thank you for the detailed feedback, and apologies for the delayed response—I had some urgent tasks come up. I've now updated the files and addressed all the issues you highlighted

  • Recursive Schema: The form now correctly resolves all $refs to build nested structures.
  • CORS Handling: GitHub URLs are auto-converted to raw.githubusercontent.com, and clear messages are shown when fetching from openethics.ai fails due to CORS.
  • Schema Validation: Format, pattern, and required field checks are now enforced. Date-time and array fields are properly handled.
  • Data Structure: Submission logic has been updated to correctly collect and structure array data.

That said, I’m still not entirely sure about the full scope of CORS blocks across different environments—I’m a bit unclear on how that works technically. If there's a better approach you recommend, especially for production, I’d love to learn more.

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.

OEDP: JavaScript Library to generate Data Passport from the Data Passport's JSON Schema

2 participants