Skip to content

Spec transformation to stay backward-compatible #33

Description

@jmini

This is more a question or a feature request than a real issue.

We would like to try following approach:


Given two specifications (old.yaml and new.yaml) representing two versions (v1 and v2) of an API. They are similar (say 90% for example) but there are braking changes between the two specs.

There could be a way to compute a second version of old.yaml (say old2.yaml) containing only the backward-compatible changes that are requested in order to transform old.yaml into new.yaml.


Is this something that someone has already investigated?
I think that the diff computed by openapi-diff tool is a good basis to realise a tool like this.
Is someone else interested?

Thank you in advance for your feedback.

Do not hesitate to tell, if I am not clear enough about what I mean.

Activity

  1. quen2404 commented on Mar 26, 2018

    @quen2404
    Member

    Yes it's a good idea. A tool which automate the generation of a backward compatible contract could be useful.

  2. jmini commented on Mar 28, 2018

    @jmini
    MemberAuthor

    Thank you for your feedback.

    Maybe a first step is to have the possibility to apply a diff result on a specification.
    Take spec1 and spec2: with the ChangedOpenApi object obtained with OpenApiCompare.fromSpecifications(spec1, spec2), when its content is applied to spec1, I should obtain spec2.

  3. itsjavi commented on Apr 16, 2018

    @itsjavi
    Contributor

    Hi, first thanks for this amazing tool <3
    I am planning to have a CI step/job in one of my projects to check for backwards incompatible changes between an old spec and new one.
    Reading the documentation I am a bit confused about how to do that without parsing the output result message.

    I am not interested in the output in that particular step, I only want openapi-diff to exit with 0 if there are no breaking changes or with an error if there was breaking changes.

    What would be the proper command for that? @quen2404

  4. jmini commented on Apr 16, 2018

    @jmini
    MemberAuthor

    I would appreciate if you were using an other issue to ask a question, because this has nothing to do with this issue. I will be happy to discuss it with you and to help you.

  5. itsjavi commented on Apr 16, 2018

    @itsjavi
    Contributor

    @jmini yeah sorry. I opened an issue for that.

  6. locked and limited conversation to collaborators on Jan 31, 2025
  7. converted this issue into a discussion #739 on Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions