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

definitions_path fix #94

Closed
wants to merge 1 commit into from
Closed

Conversation

evilbluebeaver
Copy link
Contributor

Hi!
I got my OpenApi generator broken after updating to 0.13.0.
It generates a 'components/schemas' section for custom schemas but anchors to them are wrong.
For example (I translated JSON to YAML for clarity):

paths:
  /healthz:
    get:
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/definitions/HealthCheckResult'

I don't know if my fix is a correct one but it did fix the issue for me.

@Sagebati
Copy link

I got this problem also, I'll test your fix

@Wicpar
Copy link
Collaborator

Wicpar commented Dec 12, 2023

Please let me know, i didn't see a problem on master, but i do extract the schemas.

@Sagebati
Copy link

Sagebati commented Dec 12, 2023

This indeed fixed my problem. Thank you !

@evilbluebeaver
Copy link
Contributor Author

I guess the problem is this.
s.definitions_path is only set to correct value when it's been called from 'extract_schemas' while extract flag is set.
But at the same time this leads to setting 'needs_reset' flag in ApiRouter::merge_api. So SchemaGenerator will always be recreated with definitions_path set to default "#/definitions/"

@Wicpar
Copy link
Collaborator

Wicpar commented Dec 18, 2023

Closing in favor of #96 which is a cleaner implementation. it changes the default to exctract which is generally better and can be disabled, both work.

@Wicpar Wicpar closed this Dec 18, 2023
@Wicpar Wicpar removed their request for review December 18, 2023 14:17
@Wicpar
Copy link
Collaborator

Wicpar commented Dec 18, 2023

fixed in 0.13.1

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.

3 participants