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

fix error when model property is invalid #3574

Merged
merged 3 commits into from
Jun 13, 2024

Conversation

shiron-dev
Copy link
Contributor

fix #3504

When unsuitable types are specified in the model property, the invalid code location is now reported instead of throwing an error.

When compiling the following tsp file, it is reported as follows

interface TestInterface1 {
  get1(prop: TestInterface1): TestInterface1;
}
Diagnostics were reported during compilation:

/projects/typespec/packages/samples/scratch/main.tsp:2:8 - error @typespec/openapi3/invalid-model-property: 'Interface' cannot be specified as a model property.
> 2 |   get1(prop: TestInterface1): TestInterface1;
    |        ^^^^

Found 1 error.

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:openapi3 Issues for @typespec/openapi3 emitter label Jun 13, 2024
@shiron-dev
Copy link
Contributor Author

@microsoft-github-policy-service agree

@timotheeguerin
Copy link
Member

/azp run typespec - pr tools

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timotheeguerin
Copy link
Member

Thanks for the contribution will get that merged for the release!

@azure-sdk
Copy link
Collaborator

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @typespec/openapi3
Show changes

@timotheeguerin timotheeguerin added this pull request to the merge queue Jun 13, 2024
Merged via the queue into microsoft:main with commit 147335d Jun 13, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:openapi3 Issues for @typespec/openapi3 emitter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specifying interface in operation props causes emitter to crash
3 participants