Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Jan 10, 2023

The existing santizing wasn't enough.

Fixes #155

The existing santizing wasn't enough.

Fixes #155
@kzu kzu added the enhancement New feature or request label Jan 10, 2023
@kzu kzu enabled auto-merge (rebase) January 10, 2023 21:41
@viceroypenguin
Copy link
Contributor

viceroypenguin commented Jan 10, 2023

FYI ThisAssembly.Resources already handles this, via Model.SanitizePart()

@kzu
Copy link
Member Author

kzu commented Jan 10, 2023

It doesn't (at least fully). Which is why I'm sending this. With the file I added, I still get compilation errors. (I'm using the published 1.1.2)

@kzu kzu merged commit aeca9b4 into main Jan 10, 2023
@kzu kzu deleted the dev/sanitizing branch January 10, 2023 21:45
@viceroypenguin
Copy link
Contributor

Interesting. Wonder what's different vs the other files already added (swagger-ui.json), etc.

@kzu
Copy link
Member Author

kzu commented Jan 10, 2023

perhaps being top-level? The logic on that model sanitization should probably be unified (across the other generators too) and unit-tested...

@viceroypenguin
Copy link
Contributor

Ah, just realized it- only the path parts are being sanitized, not the name itself. Works with swagger-ui.json because there's also swagger-ui.css, so swagger-ui is part of the path, not the name. 🤦🏼‍♂️

@viceroypenguin
Copy link
Contributor

Just downloaded 1.1.3, and it still misses cases. 00.VersionHistory.sql fails, when it should do _00_VersionHistory. I'd help out, but I have no idea how to fit SanitizePart() into ThisAssembly.Strings.

@kzu
Copy link
Member Author

kzu commented Jan 10, 2023

Yep, hopefully someone can end a PR if it's critical. I don't mind appending the _ myself in those corner cases. Would be nicer if it just worked, but it's not critical for me.

As for reusing the name/identifier sanitization, it could just be a static class that all projects link/include and that's it.

@viceroypenguin
Copy link
Contributor

viceroypenguin commented Jan 10, 2023

Including is easy - I just haven't read ThisAssembly.Strings well enough to figure out how to hook it in. I'll probably give you a PR for ThisAssembly.Resources later this week at least.

@devlooped devlooped locked and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problems with Resources generator generated code

3 participants