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

TypeScript: Kiota.Builder.KiotaBuilder[0]: error generating the client: the current dom node already contains a child with name #4382

Closed
NikolayLS opened this issue Mar 21, 2024 · 3 comments · Fixed by #4667
Assignees
Labels
generator Issues or improvements relater to generation capabilities. help wanted Issue caused by core project dependency modules or library type:bug A broken experience TypeScript Pull requests that update Javascript code
Milestone

Comments

@NikolayLS
Copy link

Hello!

I'm trying to generate a TypeScript API client for the following OpenApi specification:

https://vdc-download.vmware.com/vmwb-repository/dcr-public/57e38985-f93c-4dba-baaf-cc7a8f77664e/ad079dcd-ef86-4be5-8e82-5dee43c79e74/vi_json_openapi_specification_v8_0_2_0.zip

I have installed "kiota" and followed the instructions.

./kiota --version
1.12.0+1735a2ff916ebec661974d9560f1dd00d3dc349b

And this is the problem that I'm hitting:

crit: Kiota.Builder.KiotaBuilder[0]
      error generating the client: the current dom node already contains a child with name HostScsiTopologyInterface and of type CodeClass

Note: I can successfully generate API clients for Java/Python.

Sorry if the topic is already covered by another issue.

@baywet
Copy link
Member

baywet commented Mar 22, 2024

Hi @NikolayLS
Thanks for using kiota and for reaching out.
Can you generate again, passing --ll information and upload the full kiota log here please?

@NikolayLS
Copy link
Author

@baywet Thanks for the prompt response!

Here is the full kiota log:

./kiota generate -l typescript -d vi_json_openapi_specification_v8_0_2_0.yaml -c ApiClient -o ./client --ll information
info: Kiota.Builder.KiotaBu./kiota generate -l typescript -d vi_json_openapi_specification_v8_0_2_0.yaml -c ApiClient -o ./client --ll information
info: Kiota.Builder.KiotaBuilder[0]
      loaded description from local source
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/paths/~1SessionManager~1{moId}~1AcquireCloneTicket/post/responses/200/content/application~1json/schema - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ChangeNFSUserPasswordRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ChangePasswordRequestType/properties/oldPassword - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ChangePasswordRequestType/properties/newPassword - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CloneSessionRequestType/properties/cloneTicket - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ConfigureDatastorePrincipalRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/JoinDomainRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/LoginRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/QueryConnectionInfoRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/SetNFSUserRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/UploadClientCertRequestType/properties/privateKey - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostServiceTicket/properties/sessionId - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/PasswordField/properties/value - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ServiceLocatorNamePassword/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ServiceLocatorSAMLCredential/properties/token - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/SessionManagerGenericServiceTicket/properties/id - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/VirtualMachineMksTicket/properties/ticket - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/VirtualMachineTicket/properties/ticket - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CryptoKeyPlain/properties/keyData - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/KmipServerSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostActiveDirectorySpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostConnectSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostConnectSpec/properties/vimAccountPassword - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostInternetScsiHbaAuthenticationProperties/properties/chapSecret - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostInternetScsiHbaAuthenticationProperties/properties/mutualChapSecret - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostIpmiInfo/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostAccountSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostNasVolumeSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostPatchManagerPatchManagerOperationSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostSecuritySpec/properties/adminPassword - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/VAppPropertyInfo/properties/defaultValue - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/VAppPropertyInfo/properties/value - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CustomizationPassword/properties/value - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/NamePasswordAuthentication/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/SAMLTokenAuthentication/properties/token - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/TicketedSessionAuthentication/properties/ticket - The format password is not supported by Kiota for the type string and the string type will be used.
crit: Kiota.Builder.KiotaBuilder[0]
      error generating the client: the current dom node already contains a child with name HostScsiTopologyInterface and of type CodeClassilder[0]
      loaded description from local source
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/paths/~1SessionManager~1{moId}~1AcquireCloneTicket/post/responses/200/content/application~1json/schema - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ChangeNFSUserPasswordRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ChangePasswordRequestType/properties/oldPassword - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ChangePasswordRequestType/properties/newPassword - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CloneSessionRequestType/properties/cloneTicket - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ConfigureDatastorePrincipalRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/JoinDomainRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/LoginRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/QueryConnectionInfoRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/SetNFSUserRequestType/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/UploadClientCertRequestType/properties/privateKey - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostServiceTicket/properties/sessionId - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/PasswordField/properties/value - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ServiceLocatorNamePassword/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/ServiceLocatorSAMLCredential/properties/token - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/SessionManagerGenericServiceTicket/properties/id - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/VirtualMachineMksTicket/properties/ticket - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/VirtualMachineTicket/properties/ticket - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CryptoKeyPlain/properties/keyData - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/KmipServerSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostActiveDirectorySpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostConnectSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostConnectSpec/properties/vimAccountPassword - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostInternetScsiHbaAuthenticationProperties/properties/chapSecret - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostInternetScsiHbaAuthenticationProperties/properties/mutualChapSecret - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostIpmiInfo/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostAccountSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostNasVolumeSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostPatchManagerPatchManagerOperationSpec/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/HostSecuritySpec/properties/adminPassword - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/VAppPropertyInfo/properties/defaultValue - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/VAppPropertyInfo/properties/value - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/CustomizationPassword/properties/value - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/NamePasswordAuthentication/properties/password - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/SAMLTokenAuthentication/properties/token - The format password is not supported by Kiota for the type string and the string type will be used.
warn: Kiota.Builder.KiotaBuilder[0]
      OpenAPI warning: #/components/schemas/TicketedSessionAuthentication/properties/ticket - The format password is not supported by Kiota for the type string and the string type will be used.
crit: Kiota.Builder.KiotaBuilder[0]
      error generating the client: the current dom node already contains a child with name HostScsiTopologyInterface and of type CodeClass


@andrueastman
Copy link
Member

andrueastman commented Mar 27, 2024

The issue here is caused byt the openApi description contains the type HostScsiTopology and HostScsiTopologyInterface. When the refiner is creating the interface for HostScsiTopology by appending the Interface suffix, there is a collision in the names between interface to be created and the existing model HostScsiTopologyInterface.

Solution here is to have the refiner check the new interface name exists in the namespace and try to disambiguate further before trying to add it in the refiner.

var temporaryInterfaceName = interfaceNamingCallback.Invoke(modelClass);

@NikolayLS Any chance this is something you'd be willing to submit a PR for?

@andrueastman andrueastman added type:bug A broken experience TypeScript Pull requests that update Javascript code generator Issues or improvements relater to generation capabilities. help wanted Issue caused by core project dependency modules or library and removed question Needs: Attention 👋 labels Mar 27, 2024
@andrueastman andrueastman added this to the Kiota v1.15 milestone May 15, 2024
@andrueastman andrueastman self-assigned this May 15, 2024
@andrueastman andrueastman moved this from Todo 📃 to In Progress 🚧 in Kiota May 15, 2024
@andrueastman andrueastman moved this from In Progress 🚧 to In Review 💭 in Kiota May 15, 2024
@github-project-automation github-project-automation bot moved this from In Review 💭 to Done ✔️ in Kiota May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Issues or improvements relater to generation capabilities. help wanted Issue caused by core project dependency modules or library type:bug A broken experience TypeScript Pull requests that update Javascript code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants