Skip to content

fix: display correct amount of duplicate schemas #1958

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

Merged

Conversation

AllieJonsson
Copy link
Contributor

Status

READY

Description

Duplicate schema names were showing one less than the actual number of schemas (e.g. showing 1x instead of 2x when there were 2 schemas with the same name)

Another thought is that we should probably detect duplicate schemas even if indexFiles is set to false, but that breaks the (unsafe) workaround mentioned in #1733

Steps to Test or Reproduce

  1. Edit petstore.yaml:
        email:
          type: string
          format: email
+       calling_code:
+         type: number
+         enum: [1, 2, 3]
        callingCode:
          type: string
          enum: ['+33', '+420', '+33'] # intentional duplicated value
  1. generate orval with config that has indexFiles: true
  2. Notice error

@AllieJonsson AllieJonsson marked this pull request as ready for review March 2, 2025 09:07
@melloware melloware added this to the 7.7.0 milestone Mar 2, 2025
@melloware melloware added the bug Something isn't working label Mar 2, 2025
@melloware melloware merged commit 52d4c6f into orval-labs:master Mar 2, 2025
2 checks passed
@AllieJonsson AllieJonsson deleted the fix/duplicate-schemas-count branch March 2, 2025 15:53
cscovino pushed a commit to cscovino/orval that referenced this pull request Mar 3, 2025
feat(core): ✏️ add naming convention option to output
melloware pushed a commit that referenced this pull request Mar 3, 2025
* fix: display correct amount of duplicate schemas (#1958)

feat(core): ✏️ add naming convention option to output

* fix(core): 🐛 apply naming convention to target files

---------

Co-authored-by: Alice Jonsson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants