kiota icon indicating copy to clipboard operation
kiota copied to clipboard

Remove normalization from writers

Open andreaTP opened this issue 2 years ago • 5 comments

Normalization of names should happen in the refiners to allow other phases to reuse the information.

Currently, Python and Ruby are performing the normalization in the writers, and this is causing a bunch of issues.

We should move the normalization back to the refiners.

andreaTP avatar Jul 03 '23 09:07 andreaTP

@andreaTP would you be willing to take on this work?

sebastienlevert avatar Jul 28 '23 14:07 sebastienlevert

Hi @sebastienlevert , sorry for the delay I was on PTO 🙂

I started looking at this issue; unfortunately, it seems more profound than I initially thought. In the ./src/Kiota.Builder/Writers/Python there are 75 occurrences of .ToSnakeCase() and, in some places, assignments are done again by mangling the name with propertyType.Name.ToFirstCharacterUpperCase().

I'll be grateful if someone in the core team is willing to tackle this. If you are short on resources I can prioritize it, but this is going to need more coordination than expected.

andreaTP avatar Aug 07 '23 10:08 andreaTP

Invoking @baywet for chiming in here. But I agree these should happen upstream to allow for an easier use downstream.

sebastienlevert avatar Aug 07 '23 13:08 sebastienlevert

Once the code migration is complete, we should investigate building a custom analyzer to prevent any regression.

baywet avatar Sep 20 '23 16:09 baywet

re-opening as this still needs to be done for other languages. If you could address PHP next, it'd be great.

baywet avatar Oct 10 '23 16:10 baywet