Benign rust 121 installs Download

oas-rs-macros 0.9.1

“Derive macros for oas-rs”

Package first published within seven daysPackage under two months old
SHA-25638ea64db1e2790d145c942fbff9830732f56dbd146ad6c33aa362ffe98655ee2
MaleculeO(S)H(Db)Md

Evidence

imports syn::Attribute serde_attrs.rs · lines 1–8
1//! Minimal reader for the subset of `#[serde(...)]` that affects wire names.
2
3use syn::{Attribute, Ident, LitStr, Token, ext::IdentExt, meta::ParseNestedMeta};
4
5#[derive(Default)]
6pub(crate) struct SerdeAttrs {
7 pub(crate) rename: Option<String>,
8 pub( …
English function-word token "with" serde_attrs.rs · lines 21–26
21:21… e_all_fields: Option<String>,
22 /// `alias`, `with` or `deserialize_with`: serde must do the decoding.
23 pub(crate) custom_decode: bool,
24}
25
26impl …
English function-word token "and" serde_attrs.rs · lines 70–71
70:28… "ApiSchema cannot describe different serialize and deserialize names \
71 (one schema serves requests and responses): us …
Rust replaces matched string content serde_attrs.rs · lines 172–181
172:33… al,
173 }
174 }
175 "kebab-case" => original.replace('_', "-"),
176 "SCREAMING-KEBAB-CASE" => original.to_ascii_uppercase().replace('_', "-"),
177 _ => return None,
178 },
179 NameBase::Pascal => {
180 let snake = || {
181 …
imports proc_macro::TokenStream lib.rs · lines 1–22
1use proc_macro::TokenStream;
2use proc_macro2::TokenStream as TokenStream2;
3use quote::{format_ident, quote};
4use syn::{
5 Data, DataEnum, DeriveInput, Field, Fields, GenericArgument, Ident, PathArguments, Type,
6 parse_macro_input,
7};
8
9mod schema_attrs;
10mod serde_attrs;
11
12use schema_attrs::{doc_comment, field_doc};
13use serde_attrs::{NameBase, SerdeAttrs, wire_name};
14
15const JSON: &str = "::oas_rs::__private::serde_json";
16
17fn json() -> TokenStream2 {
18 JSON.parse().expect("a valid path")
19}
20
21/// The component name from `#[api_schema(name = "...")]`, or the type's name.
22fn schema_name(attrs: &[ …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.