GithubHelp home page GithubHelp logo

Comments (7)

everpcpc avatar everpcpc commented on June 28, 2024 1

另外,还有 character info

// Info represents a person/character info
type Info struct {
	Birth   string         `json:"birth,omitempty"`
	Height  string         `json:"height,omitempty"`
	Gender  string         `json:"gender,omitempty"`
	Alias   CharacterAlias `json:"alias,omitempty"`
	Source  []string       `json:"source,omitempty"`
	NameCN  string         `json:"name_cn,omitempty"`
	CV      string         `json:"cv,omitempty"`
	Twitter string         `json:"twitter,omitempty"`
}

这个里面的 source,有的地方是 string 的 anidb.net,有的地方是 array,也是类似的问题?

from api.

Sai avatar Sai commented on June 28, 2024

这个是旧版 API 遗留问题,请默认 eps 为 array,需要计数时使用新增的 eps_count。

from api.

everpcpc avatar everpcpc commented on June 28, 2024

其实我遇到的主要问题是在写程序的时候用的是同一个

// Subject respents a Bangumi subject detail
type Subject struct {
	ID          int               `json:"id"`
	URL         string            `json:"url"`
	Type        SubjectType       `json:"type"`
	Name        string            `json:"name"`
	NameCN      string            `json:"name_cn,omitempty"`
	Summary     string            `json:"summary,omitempty"`
	Eps         []Ep              `json:"eps,omitempty"`
	EpsCount    int               `json:"eps_count,omitempty"`
	AirDate     string            `json:"air_date,omitempty"`
	AirWeekdays int               `json:"air_weekday,omitempty"`
	Rating      SubjectRating     `json:"rating,omitempty"`
	Rank        int               `json:"rank,omitempty"`
	Images      Images            `json:"images,omitempty"`
	Collection  SubjectCollection `json:"collection,omitempty"`
	Character   []Character       `json:"crt,omitempty"`
	Staff       []Person          `json:"person,omitempty"`
	Topic       []Topic           `json:"topic,omitempty"`
	Blog        []Blog            `json:"blog,omitempty"`
}

如果 eps 不是 array 的话 json.Unmarshal 会抛错。
如果不好改那我先强制用 large 吧。

from api.

AnRFDev avatar AnRFDev commented on June 28, 2024

@everpcpc 我这边也遇到了同样的问题

from api.

Sai avatar Sai commented on June 28, 2024

info 里面的信息类型都是不确定的

from api.

h82258652 avatar h82258652 commented on June 28, 2024

建议small时,ep返回null。
另外传入responseGroup能否改为忽略大小写,现在传Large,效果是等价于small的。

from api.

kinokn avatar kinokn commented on June 28, 2024

info 里面的信息类型都是不确定的

这也是历史遗留问题吗?可能修复吗?
另外还有其他字段的类型是不确定的吗?

from api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.