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

feat: 'suppressReadonlyModifier' override option introduced #1354

Merged

Conversation

mironbalcerzak
Copy link
Contributor

@mironbalcerzak mironbalcerzak commented May 3, 2024

Status

READY

Fixes #1348

Description

suppressReadonlyModifier override option to stop usage of readonly modifier in models

Related PRs

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

@mironbalcerzak mironbalcerzak changed the title orval/core - suppress 'readonly' modifier usage in models feaf: 'suppressReadonlyModifier' override option introduced May 3, 2024
@melloware
Copy link
Collaborator

Is this related to any open tickets?

@mironbalcerzak mironbalcerzak changed the title feaf: 'suppressReadonlyModifier' override option introduced feat: 'suppressReadonlyModifier' override option introduced May 4, 2024
@mironbalcerzak
Copy link
Contributor Author

@melloware - found an issue in a generated code against my schema.
Someone is already addressing it here: #1352.

Bigger picture, usage of "readonly" in code is opinionated - this gives user a freedom to choose.

@melloware
Copy link
Collaborator

OK I merged that other PR. It looks like you have failing tests?

@melloware melloware added this to the 6.28.0 milestone May 4, 2024
@melloware melloware self-requested a review May 4, 2024 12:03
@melloware
Copy link
Collaborator

cc @ezequiel

@mironbalcerzak
Copy link
Contributor Author

@melloware - should be alright now

@melloware melloware merged commit 86f2cf1 into orval-labs:master May 4, 2024
2 checks passed
@mironbalcerzak mironbalcerzak deleted the core-supress_readonly_modifier branch May 4, 2024 14:20
@melloware melloware modified the milestones: 6.28.0, 6.29.0 May 13, 2024
@cliveportman
Copy link
Contributor

cliveportman commented Jun 19, 2024

Was this ever released? I'm on 6.30.2 but I'm getting suppressReadonlyModifier does not exist when trying to add to the output config. And I've got readonly throughout my generated types.

I'm assuming that because it's in the docs without a version flag, then it's meant to be in?

@melloware
Copy link
Collaborator

This was in version 6.29.0 . @mironbalcerzak can you clarify?

@cliveportman
Copy link
Contributor

cliveportman commented Jun 19, 2024

@melloware Got it. It needs to be part of the override object, it's the docs that are the issue. I'll create an issue and PR off that for correcting the docs.

@mironbalcerzak
Copy link
Contributor Author

@melloware - correct, it was released in 6.29.0.
@cliveportman - correct, it's a part of override, like this:

output: {
    override: {
        suppressReadonlyModifier: true
    }
}

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.

NonReadonly type incorrectly includes readonly fields
3 participants