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

remove support to retrieve schema from URL #457

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion dsc_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ indicatif = { version = "0.17" }
jsonschema = "0.17"
num-traits = "0.2"
regex = "1.7"
reqwest = { version = "0.12", features = ["blocking"] }
schemars = { version = "0.8.12", features = ["preserve_order"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["preserve_order"] }
Expand Down
7 changes: 0 additions & 7 deletions dsc_lib/src/dscerror.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use std::str::Utf8Error;

use indicatif::style::TemplateError;
use reqwest::StatusCode;
use thiserror::Error;
use tracing::error;
use tree_sitter::LanguageError;
Expand Down Expand Up @@ -32,12 +31,6 @@ pub enum DscError {
#[error("Function '{0}' error: {1}")]
FunctionArg(String, String),

#[error("HTTP: {0}")]
Http(#[from] reqwest::Error),

#[error("HTTP status: {0}")]
HttpStatus(StatusCode),

#[error("Function integer argument conversion error: {0}")]
IntegerConversion(#[from] std::num::ParseIntError),

Expand Down
11 changes: 0 additions & 11 deletions dsc_lib/src/dscresources/command_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,17 +465,6 @@ pub fn get_schema(resource: &ResourceManifest, cwd: &str) -> Result<String, DscE
let json = serde_json::to_string(schema)?;
Ok(json)
},
SchemaKind::Url(ref url) => {
// TODO: cache downloaded schemas so we don't have to download them every time
let mut response = reqwest::blocking::get(url)?;
if !response.status().is_success() {
return Err(DscError::HttpStatus(response.status()));
}

let mut body = String::new();
response.read_to_string(&mut body)?;
Ok(body)
},
}
}

Expand Down
3 changes: 0 additions & 3 deletions dsc_lib/src/dscresources/resource_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ pub enum SchemaKind {
/// The schema is embedded in the manifest.
#[serde(rename = "embedded")]
Embedded(Value),
/// The schema is retrieved from a URL. Required for intellisense support.
#[serde(rename = "url")]
Url(String),
}

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
Expand Down
Loading