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

Generated servicenames get too long #3854

Closed
Ksdmg opened this issue Dec 4, 2023 · 6 comments · Fixed by #4056
Closed

Generated servicenames get too long #3854

Ksdmg opened this issue Dec 4, 2023 · 6 comments · Fixed by #4056
Assignees
Labels
Csharp Pull requests that update .net code help wanted Issue caused by core project dependency modules or library Needs: Attention 👋 type:bug A broken experience WIP
Milestone

Comments

@Ksdmg
Copy link

Ksdmg commented Dec 4, 2023

When I try to generate a client for an endpoint on our ERP system, I get the following exception:

04/12/2023 14:30:54:       error generating the client: The filename, directory name, or volume label syntax is incorrect. : 'C:\Users\schaafa\AppData\Local\Temp\cefe13ac-3a41-4719-be69-731318288748\Item\ErpBOLaborSvc\TimeWeeklyViewsWithCompanyWithEmployeeNumWithWeekBeginDateWithWeekEndDateWithQuickEntryCodeWithProjectIDWithPhaseIDWithTimeTypCdWithJobNumWithAssemblySeqWithOprSeqWithRoleCdWithIndirectCodeWithExpenseCodeWithResourceGrpIDWithResourceIDWithLaborTypePseudoWithShiftWithNewRowTypeWithTimeStatus'

This is the command I was using:

kiota  generate -l CSharp -d C:\MyService.json -o C:\Users\schaafa\AppData\Local\Temp\cefe13ac-3a41-4719-be69-731318288748 -n Incoe.Epicor.Kiota.OpenAPIs

Here is the service file:
MyService.json

@github-project-automation github-project-automation bot moved this to Todo in Kiota Dec 4, 2023
@baywet baywet self-assigned this Dec 4, 2023
@baywet baywet added question generator Issues or improvements relater to generation capabilities. labels Dec 4, 2023
@baywet baywet added this to the Backlog milestone Dec 4, 2023
@baywet
Copy link
Member

baywet commented Dec 4, 2023

Hi @Ksdmg
Thanks for using kiota and for reaching out.

This is caused by this endpoint in the description:

/{currentCompany}/Erp.BO.LaborSvc/TimeWeeklyViews('{Company}','{EmployeeNum}',{WeekBeginDate},{WeekEndDate},'{QuickEntryCode}','{ProjectID}','{PhaseID}','{TimeTypCd}','{JobNum}',{AssemblySeq},{OprSeq},'{RoleCd}','{IndirectCode}','{ExpenseCode}','{ResourceGrpID}','{ResourceID}','{LaborTypePseudo}',{Shift},'{NewRowType}','{TimeStatus}')

Questions:

  • Since you're using OData, are you using OpenApi.Net.OData to convert your EDMX model into an OpenAPI description? If so, can you provide the convertionSettings you set?
  • Do you need this endpoint in your client? If not, have you tried excluding it using include/exclude path parameters?

@Ksdmg
Copy link
Author

Ksdmg commented Dec 4, 2023

Thanks for your fast response!
I'm not in control of how this schema is generated. It's from our ERP system Epicor, so I cannot share any details about how this schema is generated.
I could exclude this endpoint for now, but I might need it in the future.

@baywet
Copy link
Member

baywet commented Dec 4, 2023

Great, exclude it for now then, and if you need it later, please point the vendor to this thread.
Basically my suggestion was to change one of the conversion setting so the path parameters become query parameters instead. like we do for Microsoft Graph

@Ksdmg
Copy link
Author

Ksdmg commented Dec 5, 2023

I mean this is a fix for now, but I don't think that Kiota should only work if existing schemas get changed by big companies, which honestly will never happen.
As far as I can tell the only issue is the path length of the generated files. Can you add a setting that allows me to cut off long method names? Like allow max 20 characters?
I'm now busy removing all methods that create too long filenames, which feels kinda stupid because kiota COULD generate it, it's just a issue with the filename.

@baywet
Copy link
Member

baywet commented Dec 5, 2023

Thanks for the additional context, we could do like we do for go: use a hash for the file name if the name becomes too long.
@andrueastman is this something you think you could take over?

@baywet baywet added type:bug A broken experience help wanted Issue caused by core project dependency modules or library Csharp Pull requests that update .net code and removed generator Issues or improvements relater to generation capabilities. question labels Dec 5, 2023
@baywet baywet modified the milestones: Backlog, Kiota v1.10 Dec 5, 2023
@baywet baywet assigned andrueastman and unassigned baywet Dec 5, 2023
@baywet baywet modified the milestones: Kiota v1.10, Kiota v1.11 Jan 11, 2024
@andrueastman
Copy link
Member

Sorry I missed this one @baywet. Acknowledging this one and will take it over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Csharp Pull requests that update .net code help wanted Issue caused by core project dependency modules or library Needs: Attention 👋 type:bug A broken experience WIP
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants