You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
namespacePrefixes not available in the Context constructor #43
I want to replace the old and not supported library with this fork.
The issue I am facing is that previously there was a namespacePrefixes, used to map namespace to prefix, as an optional parameter to the constructor, when Context is created.
Is there some way to use this functionality with @mitre/jsonix?
@nik-west From looking at the code it appears to me that merely the typing is a bit off, the functionality should in fact still be there. Will investigate further.
Hi @mbaer3000 sorry for not seeing this issue. This project is still alive in at least a maintenance mode. W/r to your request, if you are able to submit a PR, please tag me and I will review it and see if we can get it merged in and released.
Hi @Amndeep7, we already opened a PR . It's a one line in scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Context.js, for initializing p before using it(it's another problem that we faced during testing). If you can review it, it will be great and we will either submit another fix for better typing, or directly push in the current one.
Thanks!
I was not the original author of the main type declaration file, but would welcome a PR with the suggested options parameter to work with the rest of the library.
Off the top of my head it may look something like this:
Activity
mbaer3000 commentedon Jul 4, 2024
Hi there! A question to the Mitre people: Is this project still alive? @bhogan-mitre @jhopper-mitre @sbowman-mitre
mbaer3000 commentedon Jul 4, 2024
@nik-west From looking at the code it appears to me that merely the typing is a bit off, the functionality should in fact still be there. Will investigate further.
Amndeep7 commentedon Aug 12, 2024
Hi @mbaer3000 sorry for not seeing this issue. This project is still alive in at least a maintenance mode. W/r to your request, if you are able to submit a PR, please tag me and I will review it and see if we can get it merged in and released.
nik-west commentedon Aug 12, 2024
Hi @Amndeep7, we already opened a PR . It's a one line in scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Context.js, for initializing p before using it(it's another problem that we faced during testing). If you can review it, it will be great and we will either submit another fix for better typing, or directly push in the current one.
Thanks!
Amndeep7 commentedon Aug 12, 2024
@nik-west I'm having @Hookwitz take a look at this in the next few days. If you could submit a separate PR, that'd be great.
Hookwitz commentedon Aug 15, 2024
@nik-west , I've approved the PR and merged it in.
In reviewing the code, it does appear the construction should be able to accept
mappingsandoptionsaccording to https://github.com/mitre/jsonix/blob/master/nodejs/scripts/jsonix.js#L5693C26-L5693C34 (hopefully that link works)To type this, there should be an optional
optionsthat is either strictly defined asnamespacePrefixs: Record<String, unknown>and/orsupportXsiType: Boolean(these are the only two options that I can see from the clause blocks within the initialize function).I was not the original author of the main type declaration file, but would welcome a PR with the suggested
optionsparameter to work with the rest of the library.Off the top of my head it may look something like this: