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

Generate source try use methods that does not exist #3609

Closed
illunix opened this issue Oct 31, 2023 · 2 comments · Fixed by #3798
Closed

Generate source try use methods that does not exist #3609

illunix opened this issue Oct 31, 2023 · 2 comments · Fixed by #3798
Assignees
Labels
type:bug A broken experience TypeScript Pull requests that update Javascript code WIP
Milestone

Comments

@illunix
Copy link

illunix commented Oct 31, 2023

I've compiled kiota source and tried to use it
When I use latest pre release version, i dont get it errors

Module '"./errorEscaped"' has no exported member 'createErrorEscapedFromDiscriminatorValue'.
Module '"./errorEscaped"' has no exported member 'serializeErrorEscaped'.

import { createErrorEscapedFromDiscriminatorValue, serializeErrorEscaped, type ErrorEscaped } from './errorEscaped';
import { type ApiError, type Parsable, type ParseNode, type SerializationWriter } from '@microsoft/kiota-abstractions';

export function createErrorsResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) {
    if(!parseNode) throw new Error("parseNode cannot be undefined");
    return deserializeIntoErrorsResponse;
}
export function deserializeIntoErrorsResponse(errorsResponse: ErrorsResponse | undefined = {} as ErrorsResponse) : Record<string, (node: ParseNode) => void> {
    return {
        "errors": n => { errorsResponse.errors = n.getCollectionOfObjectValues<ErrorEscaped>(createErrorEscapedFromDiscriminatorValue); },
    }
}
export interface ErrorsResponse extends ApiError, Parsable {
    /**
     * The errors property
     */
    errors?: ErrorEscaped[];
}
export function serializeErrorsResponse(writer: SerializationWriter, errorsResponse: ErrorsResponse | undefined = {} as ErrorsResponse) : void {
        writer.writeCollectionOfObjectValues<ErrorEscaped>("errors", errorsResponse.errors, serializeErrorEscaped);
}
import { type Parsable, type ParseNode, type SerializationWriter } from '@microsoft/kiota-abstractions';

export class ErrorEscaped implements Parsable {
    /**
     * The code property
     */
    private _code?: string;
    /**
     * The message property
     */
    private _message?: string;
    /**
     * Gets the code property value. The code property
     * @returns a string
     */
    public get code() {
        return this._code;
    };
    /**
     * Sets the code property value. The code property
     * @param value Value to set for the code property.
     */
    public set code(value: string | undefined) {
        this._code = value;
    };
    /**
     * Gets the message property value. The message property
     * @returns a string
     */
    public get message() {
        return this._message;
    };
    /**
     * Sets the message property value. The message property
     * @param value Value to set for the message property.
     */
    public set message(value: string | undefined) {
        this._message = value;
    };
}
@github-project-automation github-project-automation bot moved this to Todo in Kiota Oct 31, 2023
@baywet baywet added type:bug A broken experience TypeScript Pull requests that update Javascript code labels Oct 31, 2023
@baywet baywet added this to the Kiota v1.9 milestone Oct 31, 2023
@baywet
Copy link
Member

baywet commented Oct 31, 2023

@illunix thanks for reporting this.
@rkodev it looks like we still have race conditions between the interface, file and escaping mechanisms, would you mind having a look at this please?

@baywet baywet assigned baywet and unassigned rkodev Nov 23, 2023
@baywet baywet moved this from Todo to In Progress in Kiota Nov 23, 2023
@baywet
Copy link
Member

baywet commented Nov 24, 2023

authored #3798 which addresses the issue.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Kiota Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A broken experience TypeScript Pull requests that update Javascript code WIP
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants