question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Why does my generated type have a member of type `string option` instead of `ActualType option`?

See original GitHub issue

I generated with the schema: “https://selectapi.datascope.refinitiv.com/RestApi/v1/Authentication/$metadata”.

One of the types that is generated is

type ActionImportRequestTokenPayload =
    { Credentials: Option<string> }

but it should be

type ActionImportRequestTokenPayload =
    { Credentials: Option<DataScopeSelectApiAuthenticationCredentials> }

Looking at the --from-odata-schema output, I see a few cases of anyOf, and I see from the readme section that anyOf is not supported.

Is the current absence of support the reason these types get represented as strings?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
travis-leithcommented, Aug 11, 2021

works, thank you.

0reactions
Zaid-Ajajcommented, Aug 11, 2021

Generating the code becomes a lot more difficult, but will think about it nonetheless. Using type aliases should be easy enough for consumers now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript Type 'string' is not assignable to type
I often run into the 'not assignable' error if I have a string like 'banana' in my typescript and the compiler thinks I...
Read more >
Documentation - Object Types
It is possible to support both types of indexers, but the type returned from a numeric indexer must be a subtype of the...
Read more >
Protobuf bytes type. but my question concerns ...
Current GRPC implementation validates strings to be UTF-8 only during ... Paths are specified in terms of the Protobuf type name (not the...
Read more >
Python Type Checking (Guide)
type() returns the type of an object. These examples confirm that the type of thing is allowed to change, and Python correctly infers...
Read more >
Methods - C# Guide
Since all types in the managed type system inherit directly or indirectly from the Object class, all types inherit its members, such as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found