Skip to content

Conversation

@bterlson
Copy link
Owner

@bterlson bterlson commented Jun 6, 2024

No description provided.

ArcturusZhang and others added 30 commits May 29, 2024 08:00
Sync changes in Azure/autorest.csharp#4613

- This is to sync changes in autorest.csharp repo to maintain parity
between the MCG emitter with autorest.csharp emitter. Not new MPFD
feature.
Generator part change on this side is tracking here:
microsoft#3478
Add a place to add perf tests for using benchmark to evaluate
performance impacts
…osoft#3450)

This PR updates the `Parameter` and `PropertyDeclaration` types by
converted them into classes and adds constructors to build both types
from an `InputModelProperty`.
## Why?
Because it does not make sense to me to be able to pass something else
than a `string` in a path.
![Capture d’écran 2024-05-31 à 17 39
02](https://github.com/microsoft/typespec/assets/2571084/9005c45f-e59c-483b-a1e4-108c51e8722d)
From the doc this seems to be the way to define catch all. Currently we
are getting added to all csharp emitter PRs


https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

Particularly this part
```

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
*       @global-owner1 @global-owner2

```
Follow up to microsoft#3450. This PR
updates the `FieldDeclaration` from a record to a class to follow the
pattern set by PropertyDeclaration.
timotheeguerin and others added 30 commits June 11, 2024 22:10
…shed (microsoft#3566)

In the same way we have this logic for `cloneTypeForSymbol`
Fixes Azure/autorest.csharp#4678

We are only checking if the input type is a generic type, and then get
its generic argument if it is.
We are not checking if it is this special generic type
`System.Nullable<T>` which appears to be a generic type but we actually
want it to be non-generic but nullable.

This PR changes the final constructor that would be invoke for all cases
that a ctor of CSharpType from a `System.Type` to add a check if it is
`System.Nullable<T>`, we will use `T` as `_type`, and the arguments of
`T` as the real arguments.
support loglevel filter in playground to avoid too many verbose log as
well as user can filter logs as needed.

fixes microsoft#3554
…ference the right scalar (microsoft#3573)

```
const a = unixTimestamp.fromISO("...");
```

a would have the scalar utcDateTime not unixTimestamp
fix microsoft#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
```tsp
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.
```

---------

Co-authored-by: Timothee Guerin <[email protected]>
Co-authored-by: Timothee Guerin <[email protected]>
Currently formats to 
```
@example(
  #{
    id: "some",
    bar: "thing",
    date: utcDateTime.fromISO("2020-01-01T00:00:00Z"),
    unixDate: unixTimestamp32.fromISO("2020-01-01T00:00:00Z"),
    encodedAsRfc7231: utcDateTime.fromISO("2020-01-01T00:00:00Z"),
    dob: plainDate.fromISO("2020-01-01"),
    timeout: duration.fromISO("PT1M"),
    timeoutInSeconds: duration.fromISO("PT1M1.5S"),
    timeoutInSecondsFloat: duration.fromISO("PT0.5S"),
  }
)
```

woudl get formatted to 

```

@example(#{
    id: "some",
    bar: "thing",
    date: utcDateTime.fromISO("2020-01-01T00:00:00Z"),
    unixDate: unixTimestamp32.fromISO("2020-01-01T00:00:00Z"),
    encodedAsRfc7231: utcDateTime.fromISO("2020-01-01T00:00:00Z"),
    dob: plainDate.fromISO("2020-01-01"),
    timeout: duration.fromISO("PT1M"),
    timeoutInSeconds: duration.fromISO("PT1M1.5S"),
    timeoutInSecondsFloat: duration.fromISO("PT0.5S"),
})
```
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.