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

(WIP)Feat issue 239/json schema auto re constructor #369

Conversation

fospring
Copy link
Contributor

@fospring fospring commented Oct 29, 2023

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

use json fields to check collection type of UnorderedMap,Vector,UnorderedSet ,LookupSetand LookupMap, and auto reconstruct for those collections, but there is a problem that we can't identify LookupSetand LookupMap by json fileds

Test Plan

cd packages/near-sdk-js
pnpm run build
cd ../../examples
pnpm run build:nested-collections
pnpm run test:nested-collections

Related issues/PRs

#239

@fospring fospring changed the title Feat issue 239/json schema auto re constructor (WIP)Feat issue 239/json schema auto re constructor Oct 29, 2023
@fospring fospring force-pushed the feat-issue-239/json-schema-auto-re-constructor branch from 5f1c6b1 to 9b78616 Compare October 29, 2023 13:40
@ailisp
Copy link
Member

ailisp commented Nov 1, 2023

The code is a solid implementation of the proposal! However it's not a general enough solution to this problem. Ideally, we would like a solution to able to reconstruct instance of any JavaScript class, not only these collections.

@fospring
Copy link
Contributor Author

fospring commented Nov 2, 2023

The code is a solid implementation of the proposal! However it's not a general enough solution to this problem. Ideally, we would like a solution to able to reconstruct instance of any JavaScript class, not only these collections.

ok

@fospring
Copy link
Contributor Author

a similar PR has merged: #370, will close this MR

@fospring fospring closed this Feb 25, 2024
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.

2 participants