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

chore: updates json_version from 1.beta to 1 #752

Merged
merged 1 commit into from
Aug 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions src/command/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,15 @@ pub(crate) struct JsonOutput {
impl JsonOutput {
pub(crate) fn success(data: Value, error: Value) -> JsonOutput {
JsonOutput {
json_version: JsonVersion::OneBeta,
json_version: JsonVersion::One,
data: JsonData::success(data),
error,
}
}

pub(crate) fn failure(data: Value, error: Value) -> JsonOutput {
JsonOutput {
json_version: JsonVersion::OneBeta,
json_version: JsonVersion::One,
data: JsonData::failure(data),
error,
}
Expand Down Expand Up @@ -412,8 +412,8 @@ impl JsonData {

#[derive(Debug, Clone, Serialize)]
pub(crate) enum JsonVersion {
#[serde(rename = "1.beta")]
OneBeta,
#[serde(rename = "1")]
One,
}

#[cfg(test)]
Expand Down Expand Up @@ -445,7 +445,7 @@ mod tests {
let actual_json: JsonOutput = RoverOutput::DocsList(mock_shortlinks).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"shortlinks": [
{
Expand Down Expand Up @@ -475,7 +475,7 @@ mod tests {
let actual_json: JsonOutput = RoverOutput::FetchResponse(mock_fetch_response).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"sdl": {
"contents": "sdl contents",
Expand All @@ -493,7 +493,7 @@ mod tests {
let actual_json: JsonOutput = RoverOutput::CoreSchema(mock_core_schema).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"core_schema": "core schema contents",
"success": true
Expand Down Expand Up @@ -535,7 +535,7 @@ mod tests {
let actual_json: JsonOutput = RoverOutput::SubgraphList(mock_subgraph_list_response).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"subgraphs": [
{
Expand Down Expand Up @@ -580,7 +580,7 @@ mod tests {
.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"supergraph_was_updated": true,
"success": true,
Expand Down Expand Up @@ -618,7 +618,7 @@ mod tests {
.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"supergraph_was_updated": false,
"success": true,
Expand Down Expand Up @@ -665,7 +665,7 @@ mod tests {
RoverError::new(RoverClientError::NoSupergraphBuilds { graph_ref, source }).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"success": false
},
Expand Down Expand Up @@ -719,7 +719,7 @@ mod tests {
let actual_json: JsonOutput = RoverOutput::CheckResponse(mock_check_response).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"target_url": "https://studio.apollographql.com/graph/my-graph/composition/big-hash?variant=current",
"operation_check_count": 10,
Expand Down Expand Up @@ -773,7 +773,7 @@ mod tests {
let actual_json: JsonOutput = RoverError::new(operation_check_failure).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"target_url": "https://studio.apollographql.com/graph/my-graph/composition/big-hash?variant=current",
"operation_check_count": 10,
Expand Down Expand Up @@ -830,7 +830,7 @@ mod tests {
.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"api_schema_hash": "123456",
"field_changes": {
Expand Down Expand Up @@ -869,7 +869,7 @@ mod tests {
.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"api_schema_hash": "123456",
"supergraph_was_updated": true,
Expand Down Expand Up @@ -911,7 +911,7 @@ mod tests {
.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"api_schema_hash": null,
"subgraph_was_created": false,
Expand Down Expand Up @@ -946,7 +946,7 @@ mod tests {
let actual_json: JsonOutput = RoverOutput::Profiles(mock_profiles).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"profiles": [
"default",
Expand All @@ -967,7 +967,7 @@ mod tests {
.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"introspection_response": "i cant believe its not a real introspection response",
"success": true
Expand All @@ -986,7 +986,7 @@ mod tests {
.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"explanation_markdown": "this error occurs when stuff is real complicated... I wouldn't worry about it",
"success": true
Expand All @@ -1003,7 +1003,7 @@ mod tests {
let actual_json: JsonOutput = RoverOutput::EmptySuccess.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"success": true
},
Expand All @@ -1017,7 +1017,7 @@ mod tests {
let actual_json: JsonOutput = RoverError::new(anyhow!("Some random error")).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"success": false
},
Expand All @@ -1038,7 +1038,7 @@ mod tests {
.into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"success": false
},
Expand Down Expand Up @@ -1066,7 +1066,7 @@ mod tests {
RoverError::from(RoverClientError::BuildErrors { source }).into();
let expected_json = json!(
{
"json_version": "1.beta",
"json_version": "1",
"data": {
"success": false
},
Expand Down