Project

General

Profile

Bug #3267

Foreman 1.3 breaks API v1 compatibility for /api/hosts

Added by Daniel Lobato Garcia over 9 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

1.2 v1 hosts API used to have a nested hash for showing the environment, such as:

{"host" : { "name" : "foreman.redhat.com", "environment":{"environment":{"id":16,"name":"production"}}}

However in version 1.3, the returned JSON is slightly different (misses a nested hash for environments)

{"host" : { "name" : "foreman.redhat.com", "environment" : {"id":16,"name":"production"}}}

I think the latter looks better and v2 should be like that. Nonetheless this change might break retrocompatibility for some apps using v1 API.

I believe the error happens since this commit: https://github.com/theforeman/foreman/commit/76e5dd41bd575f7e6df7c7422660510216a9b964#diff-e9c3a7122d98b9c9f497817c8ca87843

Associated revisions

Revision 2508c6b9 (diff)
Added by Joseph Magen over 9 years ago

fixes #3267 - API v1 compatibility for /api/hosts

Revision a875a0b4 (diff)
Added by Joseph Magen over 9 years ago

fixes #3267 - API v1 compatibility for /api/hosts

(cherry picked from commit 2508c6b92ee21f5229126a15a4cefcfcaea0829d)

History

#1 Updated by Dominic Cleal over 9 years ago

  • Category set to API
  • Target version set to 1.3.1

Agreed, thanks.

#2 Updated by Greg Sutcliffe over 9 years ago

  • Legacy Backlogs Release (now unused) set to 1

#3 Updated by Greg Sutcliffe over 9 years ago

  • Target version deleted (1.3.1)

#4 Updated by Greg Sutcliffe over 9 years ago

  • Target version set to 1.15.0

#5 Updated by Dominic Cleal over 9 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Joseph Magen

#6 Updated by Anonymous over 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF