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

Clarify the scope of supported cases in todo spec in e2e demo #34

Open
MaryGao opened this issue Dec 16, 2024 · 2 comments
Open

Clarify the scope of supported cases in todo spec in e2e demo #34

MaryGao opened this issue Dec 16, 2024 · 2 comments

Comments

@MaryGao
Copy link
Contributor

MaryGao commented Dec 16, 2024

Below two cases are not supported yet in some emitters in @markcowl's todo spec pr. I'd like to clarify if both of them are in Jan e2e demo's scope.

  • Unsupported 1: Model is shared among mfd and non-mfd operations

TodoAttachment will be shared in a json operation createJson(link) and a mfd operation createForm(link). Since currently emitters would treat mfd model differently so sharing here would be an issue for Java and JavaScript and I didn't check other language yet.

I am also clarifying if there is any limitation for these cases: microsoft/typespec#5376.

  • Unsupported 2: Union cases with bytes type

I know other lanagues would only generate protocol methods for this. This seems to be a JS issue only, currently we can't handle the deserialization/serialization for union model TodoAttachment without a discriminator property.

Full support of union deserialization/serialization are problematic and a big issue in JS. Not sure we could scope to discriminated union for now?

union TodoAttachment {
  file: TodoFileAttachment,
  url: TodoUrlAttachment,
}

model TodoFileAttachment is File;

model File {
  contentType?: string;
  filename?: string;
  contents: bytes;
}

model TodoUrlAttachment {
  /** A description of the URL */
  description: string;

  /** The url */
  url: url;
}
@lirenhe
Copy link
Collaborator

lirenhe commented Dec 17, 2024

cc @lmazuel @joheredi for awareness.

@lmazuel
Copy link
Collaborator

lmazuel commented Dec 18, 2024

As we discussed, let's make the TypeSpec what we support, and keep this discussion for Jan/Feb 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants