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

feat(schema): added json schema to support schema on xcm messages #785

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

dzmitry-lahoda
Copy link
Contributor

No description provided.

@ordian ordian requested a review from KiChjang September 14, 2023 18:42
@KiChjang
Copy link
Contributor

What is this crate? Why isn't serde good enough? What use case are you encountering?

@dzmitry-lahoda
Copy link
Contributor Author

The crate allows to make schema for serde structs. Serde does alone does not allow to generate schema(afaik cannot just serde::shema_generate or something from its attributes) nor it cannot specify some schema cases (simplest one is custom serializer). We are to send XCM messages from CosmWasm contracts. In order to have API to call messages need to generate clients, CW clients generates depend on Schemars.

@KiChjang
Copy link
Contributor

KiChjang commented Sep 18, 2023

Isn't this solved by FRAME metadata already?

@dzmitry-lahoda
Copy link
Contributor Author

solved what? does parity implements JsonSchema trait?

@KiChjang
Copy link
Contributor

AFAICT this is trying to generate a schema, I looked at what this "schema" really is, and it's essentially metadata, which FRAME metadata already generates. I'm yet to be convinced that this is a change that benefits the entire ecosystem; it seems to me that this is done only to solve a specific problem for a specific use-case.

@dzmitry-lahoda
Copy link
Contributor Author

@KiChjang by ecosystem you mean "polkadot/substrate/ink" only? kind of not considering any other rust base chain, right?

@dzmitry-lahoda
Copy link
Contributor Author

dzmitry-lahoda commented Sep 18, 2023

it seems to me that this is done only to solve a specific problem for a specific use-case.

what you mean by that? SCALE and SERDE attributes also solve specific problem for specific use case. so you asked problem( use case, singualar) - i gave problem. now you asking problems?

@dzmitry-lahoda
Copy link
Contributor Author

@ordian who else I can tag to talk or what we have the only option?

Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

I think it's reasonable to add support for it as an additional feature that is disabled by default.

Please merge master to make CI happy.

bounded-collections/Cargo.toml Outdated Show resolved Hide resolved
@ordian ordian added the changelog Needs to be added to the changelog label Sep 19, 2023
@KiChjang
Copy link
Contributor

Let's step back a bit: why is this dependency absolutely necessary upstream? Can this not be solved by a newtype pattern?

@bkchr
Copy link
Member

bkchr commented Sep 29, 2023

Let's step back a bit: why is this dependency absolutely necessary upstream? Can this not be solved by a newtype pattern?

How should a newtype wrapper help for a derive macro? The derive macro then has no access to the inner type and its layout.

@dzmitry-lahoda
Copy link
Contributor Author

Let's step back a bit: why is this dependency absolutely necessary upstream? Can this not be solved by a newtype pattern?

(polkadotsdk(xcm(common))) is what exists, we needed (cosmwasm(xcm(common))).

if you know how to fix it by """newtype""" """pattern"""" please suggest. i do not know except maintaining forks.

my policy of maintaining fork is to have PR if fork is resonably meregable.

@dzmitry-lahoda dzmitry-lahoda marked this pull request as draft October 9, 2023 11:49
build-targets-check.sh Outdated Show resolved Hide resolved
@dzmitry-lahoda dzmitry-lahoda requested a review from ordian October 9, 2023 17:18
@dzmitry-lahoda dzmitry-lahoda marked this pull request as ready for review October 9, 2023 17:18
@bkchr bkchr merged commit 97973e5 into paritytech:master Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Needs to be added to the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants