Git Product home page Git Product logo

Comments (10)

baywet avatar baywet commented on June 1, 2024 1

Thanks for the additional information. @shemogumbe to confirm whether this could be the bug he was mentioning. (it's a holiday for him, we'll probably only hear back next week)

from kiota.

shemogumbe avatar shemogumbe commented on June 1, 2024 1

Yes, this could be related, classes are generated and nested, the more the nesting, we lose the ability to import the classes

from kiota.

baywet avatar baywet commented on June 1, 2024

Hi @pjmagee
Thanks for using kiota and for reaching out.
To be clear, is the import path is correct? i.e. is it constructed properly to point to the type to be imported? (no mismatch in structure/casing that you could edit out).

What happens if you create a schema component for the anyof type and refer to that for the items schema? Do you still run into the same issue?

from kiota.

pjmagee avatar pjmagee commented on June 1, 2024

I think because its nested, the import is also broken, so the import path is also kind of incorrect. It also doesnt get picked up correctly.

using Github Copilot, it actually mentions something similar...

image

from kiota.

pjmagee avatar pjmagee commented on June 1, 2024

I tried to import from the class, but im struggling to change the import statement to getting it to be detected correctly.

from kiota.

pjmagee avatar pjmagee commented on June 1, 2024

Removing the import and doing this seems to be "acceptable" according to Python/PyCharm

"included": lambda n : setattr(self, 'included', n.get_collection_of_object_values(PriceAssessmentsGetResponse.PriceAssessmentsGetResponse_included)),

It has to be fixed up in a few places, but Class.Class works, couldnt figure out the right import way to get it working with the nested class.

from kiota.

pjmagee avatar pjmagee commented on June 1, 2024

I think this may be part of a larger issue. Looking at the LocationSpreadsGetResponse_included generated class:

It seems to not generate some of the fields. Unsure if its related to the anyOf or due to the anyOf

image

from kiota.

baywet avatar baywet commented on June 1, 2024

Thanks for the additional information. @shemogumbe do you think this could be the same thing you were referring to in microsoftgraph/msgraph-beta-sdk-python#391 ??

from kiota.

pjmagee avatar pjmagee commented on June 1, 2024

I know our spec isn't perfect, so also confirmed its not a spec specific thing and C# looks to be generating okay.. Just example showing intellisense/properties being generated correctly

image

from kiota.

baywet avatar baywet commented on June 1, 2024

@shemogumbe I can see the other issue has been closed, does that mean this one is solved as well?

from kiota.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.