Граф коммитов

2503 Коммитов

Автор SHA1 Сообщение Дата
Timothee Guerin 04b198693d
Setup api extractor for xml library (#4335)
Ideally we can connect that to api view to report changes to the api
without having to commit extra files to the repo.

But for now this at least enforce the good pattern for api extractor
2024-09-04 21:12:36 +00:00
Timothee Guerin 74627ec770
Fix labels CI (#4336)
Seems like that was merged with conflict or failure
2024-09-04 17:58:53 +00:00
Wei Hu eacbc248f8
Remove extra space to fix VS debug attachment (#4333)
Resolves https://github.com/microsoft/typespec/issues/4332

extra space in argument for `child_process.spawn` ended up into missing
2024-09-04 09:23:17 +00:00
Srikanta 0f8dcf4ea0
Remove unused test directory (#4318) 2024-09-04 02:06:37 +00:00
Srikanta 73e61f9202
Java codegen - clean up build steps (#4323)
This PR cleans up some of the build steps that are not required. Latest
JDK LTS version (Java 21) is pre-installed in 1es hosts and we don't
need to explicitly download and install this. So, this PR comments out
the code that does this as we might still need this in the future to
install newer versions of Java that are not available on 1es.
2024-09-04 02:03:41 +00:00
Kyle Zhang 663d057c08
add test cases for Xml lib (#4306)
- set the attribute value via encodedName
- set the value on scalar via encodedName
- emit error if missing the 2nd argument

---------

Co-authored-by: Kyle Zhang <v-zhanh@microsoft.com>
2024-09-03 11:50:56 +00:00
Dapeng Zhang a5546cafea
fix the response map issue in the emitter (#4307)
Fixes https://github.com/Azure/autorest.csharp/issues/5027
2024-09-03 08:42:31 +00:00
Weidong Xu bc1c599517
Java sync to 16e2939c38dec8bb5322214d1a99f2c44284a2bf (#4293)
I didn't include https://github.com/Azure/autorest.java/pull/2936

I will remove prenamer in next PR.
2024-09-03 08:22:21 +00:00
Srikanta c7ed92edbb
Java codegen: Run cadl ranch tests (#4303)
This PR enables starting the test server and running the Java tests
against the server.
2024-09-03 07:18:57 +00:00
Pan Shao 11a01ce1dc
Read AllowReserved value (#4294)
Fix https://github.com/Azure/autorest.csharp/issues/4966

---------

Co-authored-by: Pan Shao <pashao@microsoft.com>
2024-09-03 02:15:54 +00:00
Crystal YU c2b80f79c7
support enum discrimintor (#4279)
Fix https://github.com/microsoft/typespec/issues/4002

- implement inheritance with enum discriminator
- onboard http\type\model\inheritance\emum-discriminator cadl-ranch test
project
2024-09-02 02:31:53 +00:00
Timothee Guerin 8635849242
Fix: Validating cross namespace (#4304) 2024-08-29 22:37:04 +00:00
Christopher Radek 2278c42581
tsp-openapi3 - improve model generation of schemas using allOf (#4232)
Fixes https://github.com/microsoft/typespec/issues/4152
Depends on https://github.com/microsoft/typespec/pull/4216

This PR updates how tsp-openapi3 handles generating models for schemas
that use `allOf`.

Currently `allOf` is ignored unless there is only 1 member and that
member is a schema reference. In this scenario, the model extends the
single member.

This update now takes all of the schema `allOf` members into
consideration when generating a model.
- inline-schemas have their properties merged into the model's
properties
- schema references without a discriminator defined are spread into the
model
- if only 1 schema reference contains a discriminator, then the model
extends it, otherwise these schema references are spread as well.

---------

Co-authored-by: Christopher Radek <Christopher.Radek@microsoft.com>
2024-08-29 21:54:45 +00:00
Christopher Radek 5a75506953
tsp-openapi3 - scope top-level parameters to Parameters namespace (#4216)
Fixes #4151 

This PR updates tsp-openapi3's model generation so that all top-level
parameters (`#/components/parameters`) are nested in a `Parameters`
block namespace.

Prior to this change, if top-level parameter had the same name as a
top-level schema, we would attempt to merge the two. This worked OK if
the schema was an object type, but led to broken results if the schema
was anything else.

Note:
In the linked issue, it was suggested that top-level schemas not be
scoped to their own namespace, so if a schema is referenced by a
parameter, it will now qualify it with the file-level namespace. This PR
introduces a `context` object that contains some state that can be
passed around. This is useful for keeping track of the file-level
namespace and using it when necessary, but the context will also be
useful in cases where we need to look at the definition of a referenced
schema from another schema.

---------

Co-authored-by: Christopher Radek <Christopher.Radek@microsoft.com>
2024-08-29 18:55:59 +00:00
Timothee Guerin 1b659ad8c5
Do not mutate type stack (#4299) 2024-08-29 17:36:08 +00:00
dependabot[bot] 2e6cd73b23
Bump micromatch from 4.0.7 to 4.0.8 in /packages/http-client-java (#4250)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7
to 4.0.8.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/micromatch/micromatch/blob/4.0.8/CHANGELOG.md">micromatch's
changelog</a>.</em></p>
<blockquote>
<h2>[4.0.8] - 2024-08-22</h2>
<ul>
<li>backported CVE-2024-4067 fix (from v4.0.6) over to 4.x branch</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8bd704ec0d"><code>8bd704e</code></a>
4.0.8</li>
<li><a
href="a0e68416a4"><code>a0e6841</code></a>
run verb to generate README documentation</li>
<li><a
href="4ec288484f"><code>4ec2884</code></a>
Merge branch 'v4' into hauserkristof-feature/v4.0.8</li>
<li><a
href="03aa805217"><code>03aa805</code></a>
Merge pull request <a
href="https://redirect.github.com/micromatch/micromatch/issues/266">#266</a>
from hauserkristof/feature/v4.0.8</li>
<li><a
href="814f5f70ef"><code>814f5f7</code></a>
lint</li>
<li><a
href="67fcce6a10"><code>67fcce6</code></a>
fix: CHANGELOG about braces &amp; CVE-2024-4068, v4.0.5</li>
<li><a
href="113f2e3fa7"><code>113f2e3</code></a>
fix: CVE numbers in CHANGELOG</li>
<li><a
href="d9dbd9a266"><code>d9dbd9a</code></a>
feat: updated CHANGELOG</li>
<li><a
href="2ab13157f4"><code>2ab1315</code></a>
fix: use actions/setup-node@v4</li>
<li><a
href="1406ea38f3"><code>1406ea3</code></a>
feat: rework test to work on macos with node 10,12 and 14</li>
<li>Additional commits viewable in <a
href="https://github.com/micromatch/micromatch/compare/4.0.7...4.0.8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=micromatch&package-manager=npm_and_yarn&previous-version=4.0.7&new-version=4.0.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/typespec/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-29 17:02:20 +00:00
Timothee Guerin 06da57d4c4
Fix regression in validation of operation params versioning not taking operation availability into account (#4297) 2024-08-29 16:26:35 +00:00
Timothee Guerin 133321f9c0
Add validation to make sure operation params reference models available in the current version (#4179)
fix [#3920](https://github.com/microsoft/typespec/issues/3920)
fix [#3134](https://github.com/microsoft/typespec/issues/3134)
2024-08-29 13:25:14 +00:00
Kyle Zhang 302e0c7c08
new test cases for openAPI 3.0 (#4195)
add some new cases
1. @oneOf decorator can only be used on a union.
2. throws diagnostics for null enum definitions

---------

Co-authored-by: Kyle Zhang <v-zhanh@microsoft.com>
2024-08-29 12:48:31 +00:00
Timothee Guerin a45f2cc4a3
Stop json schema from crashing on unknown scalar (#4150)
fix #4096
2024-08-29 12:44:54 +00:00
Kyle Zhang 92684d90e2
Fix Bug for OpenAPI 3 Emitter crash on @useAuth({}) (#4133)
OpenAPI 3 Emitter crash on @useAuth({}). 
seems the diagnostics is not initial before add item. 

fix: https://github.com/microsoft/typespec/issues/4097

---------

Co-authored-by: Kyle Zhang <v-zhanh@microsoft.com>
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
Co-authored-by: Christopher Radek <14189820+chrisradek@users.noreply.github.com>
2024-08-27 23:57:42 +00:00
Jorge Rangel 21736711f3
Add support for additional props model property in models (#4277)
Contributes to https://github.com/microsoft/typespec/issues/4007. The
serialization changes will be included in follow up PR(s).
2024-08-27 21:28:26 +00:00
Srikanta 7600a2bb58
Java Http client generator: generate tests (#4251) 2024-08-27 07:31:07 +00:00
Allen Zhang 9e37021186
Accessibility, increase playground footer contrast (#4276) 2024-08-26 20:23:04 +00:00
ShivangiReja fc1a6c3d88
Adopt http\type\property\value-types from cadl ranch (#4273)
Fixes: https://github.com/microsoft/typespec/issues/4010

---------

Co-authored-by: ShivangiReja <shivangi.reja@microsoft.com>
2024-08-26 20:07:00 +00:00
Mario Guerra 8dfacdb08e
minor edits and corrections (#4183) 2024-08-26 18:48:34 +00:00
Mingzhe Huang e6040ed56a
feat(http-client-csharp): `@encode(string)` support for int types (#4186)
- add `SerializationFormat.String` to indicate a mandatory serialization
to string
- update clientmodel to add int-to-string serialization/deserialization
- update test case
- add test helper

part of https://github.com/Azure/autorest.csharp/issues/4919

---------

Co-authored-by: Mingzhe Huang (from Dev Box) <mingzhehuang@microsoft.com>
2024-08-26 07:12:42 +00:00
m-nash b4005cdcbb
adopt http/type/property/optionality (#4267)
Fixes https://github.com/microsoft/typespec/issues/4009
2024-08-26 05:06:43 +00:00
m-nash b27efa97c4
Add support for discriminated models (#4253)
Fixes https://github.com/microsoft/typespec/issues/4006
Fixes https://github.com/microsoft/typespec/issues/3500
2024-08-26 03:57:46 +00:00
ShivangiReja 142f44fa23
Adopt http\encode\datetime from cadl ranch (#4252)
Fixes: https://github.com/microsoft/typespec/issues/3972

---------

Co-authored-by: ShivangiReja <shivangi.reja@microsoft.com>
2024-08-23 23:38:32 +00:00
Crystal YU d932462149
implement array as header and query, and format different type to string (#4213)
Fix https://github.com/microsoft/typespec/issues/4205
Fixes https://github.com/microsoft/typespec/issues/3973

Problem to solve:
When any type except string (e.g. int, TimeSpan and so on) as
header/query, it is not correct covert to correct format, and when there
is an array as header/query, it does not serialize correct in connection
format (such as cvs, pipe and so on).

- call TypeFormatters.ConvertToString to covert this type to correct
format
- when it is an array, we need to convert to string in correct
collection format.
2024-08-23 18:34:16 +00:00
Jorge Rangel 4196cd3b0c
Adopt http\type\property\nullable from cadl ranch (#4249)
fixes: https://github.com/microsoft/typespec/issues/4008
2024-08-23 17:51:42 +00:00
ShivangiReja 23d00156cf
Adopt http\type\dictionary from cadl ranch (#4246)
Fixes: https://github.com/microsoft/typespec/issues/3993

---------

Co-authored-by: ShivangiReja <shivangi.reja@microsoft.com>
2024-08-23 17:16:14 +00:00
Jorge Rangel 15be039d0c
Adopt http\parameters\basic from cadl ranch (#4241)
fixes: https://github.com/microsoft/typespec/issues/3974
2024-08-22 19:16:01 +00:00
Kyle Zhang ff56d83bc0
Fix Doc issue for opexamples (#4201)
Fix Doc issue for
[#4192](https://github.com/microsoft/typespec/issues/4192)

Co-authored-by: Kyle Zhang <v-zhanh@microsoft.com>
2024-08-22 16:59:11 +00:00
Dapeng Zhang 89202ef4eb
Read examples from TCGC in the emitter (#4086)
Adopts the `examples` from TCGC
2024-08-22 08:02:16 +00:00
m-nash 7997d9dd44
Adopt http/type/model/usage (#4237)
Fixes https://github.com/microsoft/typespec/issues/4000
2024-08-22 05:53:23 +00:00
m-nash 91dd18bfdb
Adopt http/type/model/empty (#4236)
Fixes https://github.com/microsoft/typespec/issues/3998
2024-08-22 05:22:42 +00:00
m-nash f7d395fc82
Adopt http/type/enum/fixed (#4235)
Fixes https://github.com/microsoft/typespec/issues/3997
2024-08-22 04:20:52 +00:00
JoshLove-msft 9ce9c57d11
Add EnclosingType property to output types (#4231)
Fixes https://github.com/microsoft/typespec/issues/4091
2024-08-22 03:50:39 +00:00
m-nash cc6e584e40
Add support for http/type/enum/extensible (#4234)
Fixes https://github.com/microsoft/typespec/issues/3996
2024-08-22 03:46:29 +00:00
m-nash c1ca0a74f3
Add support for http/type/union (#4233)
Fixes https://github.com/microsoft/typespec/issues/3995
2024-08-22 03:03:10 +00:00
Jorge Rangel 371d5c1adb
Add support for spread of aliases & models (#4199)
This PR adds support for spread of aliases & models within a client
operation's parameters.

fixes: https://github.com/microsoft/typespec/issues/3831

---------

Co-authored-by: m-nash <64171366+m-nash@users.noreply.github.com>
2024-08-21 23:27:56 +00:00
Dapeng Zhang e8c493e015
refinement to the type cache in dotnet emitter (#4204)
This PR introduces a global cache for types when we are doing the type
conversion from TCGC's type to our input types in the emitter.
2024-08-21 05:45:53 +00:00
m-nash 8d808476f9
Add http/type/scalar (#4223)
Fixes https://github.com/microsoft/typespec/issues/3994

Contributes to https://github.com/microsoft/typespec/issues/4208
2024-08-21 04:15:11 +00:00
JoshLove-msft d9faa2ac04
Add enclosingType to InputModelProperty (#4221)
Contributes to https://github.com/microsoft/typespec/issues/4091
2024-08-20 23:32:52 +00:00
JoshLove-msft 1fba540387
Visitor fixes (#4217) 2024-08-20 18:07:22 +00:00
m-nash 9961dbefaa
Http type array (#4212)
Fixes https://github.com/microsoft/typespec/issues/3992
2024-08-20 16:15:02 +00:00
m-nash 2d4f55f921
Content helper (#4211)
Fixes https://github.com/microsoft/typespec/issues/4210
2024-08-20 01:58:19 +00:00
m-nash 197b7095fd
Http payload media type (#4209)
Fixes https://github.com/microsoft/typespec/issues/3980
2024-08-19 20:56:06 +00:00