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

Restricting extra keys causes memory leak in compojure-api #433

Open
frenchy64 opened this issue Dec 1, 2021 · 2 comments
Open

Restricting extra keys causes memory leak in compojure-api #433

frenchy64 opened this issue Dec 1, 2021 · 2 comments
Labels

Comments

@frenchy64
Copy link
Contributor

frenchy64 commented Dec 1, 2021

The fix #415 reportedly causes a memory leak in compojure-api, which assumes keys of a map schema never change their equality: metosin/compojure-api#454

@frenchy64
Copy link
Contributor Author

@gfredericks is there another solution to this? Could we move this code to the generators lib instead?

@gfredericks
Copy link
Contributor

gfredericks commented Dec 4, 2021

It does seem like moving it to generators would be better.

Looking back at it it seems like this is where you'd want to do the filtering, but at this point in the code we only have the spec, not the schema: https://github.com/plumatic/schema-generators/blob/b0ecf2c8659ca985144c74e4be2a5a7c9e55596f/src/schema_generators/generators.cljc#L78

Line 211 presumably could add some information to the spec (as metadata?); I'm not 100% sure that it's safe to just check if the schema is a map and look for keys that aren't a special type, but if so then seems like it would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants