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

Add spread test cases #247

Merged
merged 21 commits into from
Apr 18, 2023
Merged

Add spread test cases #247

merged 21 commits into from
Apr 18, 2023

Conversation

MaryGao
Copy link
Member

@MaryGao MaryGao commented Mar 28, 2023

Cadl Ranch Contribution Checklist:

  • I have written a scenario spec
  • I have meaningful @scenario names. Someone can look at the list of scenarios and understand what I'm covering.
  • I have written a mock API
  • I have used @scenarioDocs for extra scenario description and to tell people how to pass my mock api check.

@changeset-bot
Copy link

changeset-bot bot commented Mar 28, 2023

🦋 Changeset detected

Latest commit: db3d34e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@azure-tools/cadl-ranch-specs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pshao25 pshao25 requested a review from chunyu3 March 28, 2023 05:48
Copy link
Member

@chunyu3 chunyu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add one more scenario: Spread an Alias which contains model as property?

model Thing {
  @doc("name of the Thing")
  name: string;
  @doc("age of the Thing")
  age: int32;
}

alias ThingAliasWithModel = {
  @path id: string;
  ...Thing;
  @header top: int32;
};

op spreadAliasWithModel( ...ThingAliasWithModel ): OKResponse;

@MaryGao
Copy link
Member Author

MaryGao commented Mar 29, 2023

@iscai-msft @timotheeguerin @weidongxu-microsoft Could you help review these cases?

Copy link
Member

@weidongxu-microsoft weidongxu-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java should have supported the spread. Not sure about .NET

packages/cadl-ranch-specs/http/spread/main.tsp Outdated Show resolved Hide resolved
packages/cadl-ranch-specs/http/spread/main.tsp Outdated Show resolved Hide resolved
packages/cadl-ranch-specs/http/spread/main.tsp Outdated Show resolved Hide resolved
""")
@route("/alias/request-parameter/{id}")
@put
op spreadAliasAsRequestParameter(...AliasRequestParameter): OkResponse;
Copy link
Member

@lmazuel lmazuel Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This scenario is ok, this is not a quantum model since this is an alias.

In spirit, should generate something like:

void spreadAliasAsRequestParameter(id: string, x_ms_test_header: string, name: string)

@MaryGao
Copy link
Member Author

MaryGao commented Apr 6, 2023

Can we add one more scenario: Spread an Alias which contains model as property?

model Thing {
  @doc("name of the Thing")
  name: string;
  @doc("age of the Thing")
  age: int32;
}

alias ThingAliasWithModel = {
  @path id: string;
  ...Thing;
  @header top: int32;
};

op spreadAliasWithModel( ...ThingAliasWithModel ): OKResponse;

Pls notice the case is not updated because the discussion is not finalized #247 (comment)

I updated the comment and removed the cases with discussions over them. Pls help review again.

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

Successfully merging this pull request may close these issues.

5 participants